ÔN TẬP CTDL
ÔN TẬP CTDL
18. Which of the following data structures can be used for parentheses
matching?
a) n-ary tree
b) queue
c) priority queue
d) stack
View Answer
Answer: d
Explanation: For every opening brace, push it into the stack, and for
every closing brace, pop it off the stack. Do not take action for any
other character. In the end, if the stack is empty, then the input has
balanced parentheses.
Answer: b
Explanation: Top tree is a type of data structure which is based on
unrooted dynamic binary tree and is used to solve path related
problems. It allows an algorithm called divide and conquer.
for(i=0;i<len;i++)
push(str[i]); // pushes an element into stack
for(i=0;i<len;i++)
pop(); //pops an element from the stack}
a) yrdnuof nas
b) foundry nas
c) sanfoundry
d) san foundry
View Answer
Answer: a
Explanation: First, the string ‘san foundry’ is pushed one by one into the
stack.
When it is popped, the output will be as ‘yrdnuof nas’.
24. Which of the following data structure can provide efficient searching
of the elements?
a) binary search tree
b) unordered lists
c) 2-3 tree
d) treap
View Answer
Answer: c
Explanation: The average case time for lookup in a binary search tree,
treap and 2-3 tree is O(log n) and in unordered lists it is O(n). But in the
worst case, only the 2-3 trees perform lookup efficiently as it takes O(log
n), while others take O(n).
25. What is an AVL tree?
a) a tree which is unbalanced and is a height balanced tree
b) a tree which is balanced and is a height balanced tree
c) a tree with atmost 3 children
d) a tree with three children
View Answer
Answer: b
Explanation: It is a self balancing tree with height difference atmost 1.
26. What is the time complexity for searching a key or integer in Van
Emde Boas data structure?
a) O (M!)
b) O (log M!)
c) O (log (log M))
d) O (M2)
View Answer
Answer: c
Explanation: In order to search a key or integer in the Van Emde Boas
data structure, the operation can be performed on an associative array.
Hence, the time complexity for searching a key or integer in Van Emde
Boas data structure is O (log (log M)).
The optimal data structure used to solve Tower of Hanoi is _________
a) Tree
b) Heap
c) Priority queue
d) Stack
Multiple Choice Questions for Data Structures
1. Minimum number of fields in each node of a doubly linked list is
____
(A) 2
(B) 3
(C) 4
(D) None of the above
Ans: B
3
2. A graph in which all vertices have equal degree is known as ____
(A) Complete graph
(B) Regular graph
(C) Multi graph
(D) Simple graph
Ans: A
Complete graph
3. A vertex of in-degree zero in a directed graph is called a/an
(A) Root vertex
(B) Isolated vertex
(C) Sink
(D) Articulation point
Ans: C
Sink
4. A graph is a tree if and only if graph is
(A) Directed graph
(B) Contains no cycles
(C) Planar
(D) Completely connected
Ans: B
Contains no cycles
5. The elements of a linked list are stored
(A) In a structure
(B) In an array
(C) Anywhere the computer has space for them
(D) In contiguous memory locations
Ans: C
Anywhere the computer has space for them
6. A parentheses checker program would be best implemented using
(A) List
(B) Queue
(C) Stack
(D) Any of the above
Ans: C
Stack
7. To perform level-order traversal on a binary tree, which of the
following data structure will be required?
(A) Hash table
(B) Queue
(C) Binary search tree
(D) Stack
Ans: B
Queue
8. Which of the following data structure is required to convert
arithmetic expression in infix to its equivalent postfix notation?
(A) Queue
(B) Linked list
(C) Binary search tree
(D) None of above
Ans: D
None of above
9. A binary tree in which all its levels except the last, have maximum
numbers of nodes, and all the nodes in the last level have only one
child it will be its left child. Name the tree.
(A) Threaded tree
(B) Complete binary tree
(C) M-way search tree
(D) Full binary tree
Ans: B
Complete binary tree
10. Which of following data structure is more appropriate for
implementing quick sort iteratively?
(A) Deque
(B) Queue
(C) Stack
(D) Priority queue
Ans: C
Stack
11. The number of edges in a complete graph of n vertices is
(A) n(n+1)/2
(B) n(n-1)/2
(C) n2
/2
(D) n
Ans: B
n(n-1)/2
12. If two trees have same structure and but different node content,
then they are called ___
(A) Synonyms trees
(B) Joint trees
(C) Equivalent trees
(D) Similar trees
Ans: D
Similar trees
13. If two trees have same structure and node content, then they are
called ____
(A) Synonyms trees
(B) Joint trees
(C) Equivalent trees
(D) Similar trees
Ans: C
Equivalent trees
14. Finding the location of a given item in a collection of items is called
……
A. Discovering
B. Finding
C. Searching
D. Mining
Ans. C
searching
15. The time complexity of quicksort is ……..
A. O(n)
B. O(logn)
C. O(n2)
D. O(n logn)
Ans. D
O(n logn)
16. Quick sort is also known as ……..
A. merge sort
B. tree sort
C. shell sort
D. partition and exchange sort
Ans. D
partition and exchange sort
17. ………. sorting is good to use when alphabetizing a large list of names.
A. Merge
B. Heap
C. Radix
D. Bubble
Ans. C
Radix
18. The total number of comparisons in a bubble sort is ….
A. O(n logn)
B. O(2n)
C. O(n2)
D. O(n)
Ans. A
O(n logn)
19. ……… form of access is used to add and remove nodes from a queue.
A. LIFO, Last In First Out
B. FIFO, First In First Out
C. Both a and b
D. None of these
Ans. B
FIFO, First In First Out
20. New nodes are added to the ……… of the queue.
A. Front
B. Back
C. Middle
D. Both A and B
Ans. B
Back
21. The term push and pop is related to
A. Array
B. Lists
C. Stacks
D. Trees
Ans. C
Stacks
22. Which of the following is an application of stack?
A. finding factorial
B. tower of Hanoi
C. infix to postfix
D. all of the above
Ans. D
all of the above
23. The operation of processing each element in the list is known as ……
A. sorting
B. merging
C. inserting
D. traversal
Ans. D
traversal
24. The situation when in a linked list START=NULL is ….
A. Underflow
B. Overflow
C. Houseful
D. Saturated
Ans. A
Underflow
25. Which of the following are two-way lists?
A. Grounded header list
B. Circular header list
C. Linked list with header and trailer nodes
D. List traversed in two directions
Ans. D
List traversed in two directions
26. Which is the pointer associated with the availability list?
A. FIRST
B. AVAIL
C. TOP
D. REAR
Ans. B
AVAIL
27. Which of the following data structure can’t store the non-
homogeneous data
elements?
A) Arrays
B) Records
C) Pointers
D) Stacks
Ans. A
Arrays
28. Which of the following is non-liner data structure?
A) Stacks
B) List
C) Strings
D) Trees
Ans. D
Trees
29. To represent hierarchical relationship between elements, which data
structure is suitable?
A) Dequeue
B) Priority
C) Tree
D) Graph
Ans. C
Tree
30. Identify the data structure which allows deletions at both ends of the
list but
insertion at only one end.
A) Input restricted dequeue
B) Output restricted qequeue
C) Priority queues
D) Stack
Ans. A
Input restricted dequeue
Set 1
This set of MCQ questions on stack and queue in data structure includes
objective
questions on overview of stack and its implementation. It also includes
MCQ
questions about algorithms for push and pop, various stack
implementation arrays on
stack and queue in data structure.
1) ……… form of access is used to add and remove nodes from a queue.
A. LIFO, Last In First Out
B. FIFO, First In First Out
C. Both a and b
D. None of these
2) In liked representation of stack ……. holds the elements of the stack.
A. INFO fields
B. TOP fields
C. LINK fields
D. NULL fields
3) …….. form of access is used to add remove nodes from a stack.
A. LIFO
B. FIFO
C. Both A and B
D. None of these
4) In the linked representation of the stack ……… behaves as the top
pointer variable
of stack.
A. Stop pointer
B. Begin pointer
C. Start pointer
D. Avail pointer
5) New nodes are added to the ……… of the queue.
A. Front
B. Back
C. Middle
D. Both A and B
6) In linked representation of stack the null pointer of the last node in
the list signals
……….
A. Beginning of the stack
B. Bottom of the stack
C. Middle of the stack
D. In between some value
7) What happens when you push a new node onto a stack?
A. The new node is placed at the front of the linked list
B. The new node is placed at the back of the linked list
C. The new node is placed at the middle of the linked list
D. No Changes happens
8) A queue is a ………
A. FIFO
B. LIFO
C. FILO
D. LOFI
9) Which of the following name does not relate to stacks?
A. FIFO lists
B. LIFO lists
C. Piles
D. Push down lists
10) The retrieval of items in a stack is ……….. operation.
A. push
B. pop
C. retrieval
D. access
11) The term push and pop is related to
A. Array
B. Lists
C. Stacks
D. Trees
12) Which is the pointer associated with the stack?
A. FIRST
B. FRONT
C. TOP
D. REAR
13) The elements are removal from a stack in ………. order.
A. Reverse
B. Hierarchical
C. Alternative
D. Sequential
14) The insertion operation in the stack is called ………
A. insert
B. push
C. pop
D. top
15) …… is the term used to insert an element into stack.
A. Push
B. Pull
C. Pop
D. Pump
16) Stack follows the strategy of ……..
A. LIFO
B. FIFO
C. LRU
D. RANDOM
17) ………. is the term used to delete an element from the stack.
A. Push
B. Pull
C. Pop
D. Pump
18) Deletion operation is done using ……… in a queue.
A. front
B. rear
C. top
D. list
19) A pointer variable which contains the location at the top element of
the stack is
called …..
A. Top
B. Last
C. Final
D. End
20) Which of the following is an application of stack?
A. finding factorial
B. tower of Hanoi
C. infix to postfix
D. all of the above
Answers:
1) B. FIFO, First In First Out
2) A. INFO fields
3) A. LIFO
4) C. Start pointer
5) B. Back
6) B. Bottom of the stack
7) A. The new node is placed at the front of the linked list
8) A. FIFO
9) A. FIFO lists
10) B. pop
11) C. Stacks
12) C. TOP
13) A. Reverse
14) B. push
15) A. Push
16) A. LIFO
17) C. Pop
18) A. front
19) A. Top
20) D. all of the above
Set 2
1) The queue in which the insertion takes place in the first position after
of last
element is a ……
A. priority
B. dequeue
C. circular
D. linked
2) Before inserting into stack one must check the condition ………
A. Overflow
B. Underflow
C. Maximum elements
D. Existing elements
3) The another name of dequeue is ………
A. divided queue
B. distributed queue
C. double ended queue
D. design queue
4) Before deletion condition into stack …… has to be checked.
A. Overflow
B. Underflow
C. Maximum elements
D. Existing elements
5) In dequeue, insertion and deletion takes place of ……….
A. front, rear end
B. only at rear end
C. only at front end
D. both the ends
6) When does Top value of stack change in insertion process?
A. Before insertion
B. After insertion
C. At the time of insertion
D. While checking overflow
7) A queue in which insertion and deletion takes places from any
position is called
……
A. circular queue
B. random of queue
C. priority
D. dequeue
8) Deletion in the linked stack takes place by deleting ……..
A. Node pointed by the start process.
B. End of the list
C. Beginning of the list
D. Middle of the list
9) Which of the following name does not relate to stacks?
A. FIFO lists
B. LIFO list
C. piles
D. push-down lists
10) The condition …….. indicate the queue is empty.
A. Front=Null
B. Null=Front
C. Front=Rear
D. Rear=Null
11) Which of the following is not the type of queue?
A. Ordinary queue
B. Special queue
C. Priority queue
D. Circular queue
12) The value of REAR is increased by 1 when …….
A. An element is deleted in a queue
B. An element is traversed in a queue
C. An element is added in a queue
D. An element is merged in a queue
13) The operations that can be done in a circular queue is/are …..
A. Insert from the front end
B. Delete from front end
C. Display queue contents
D. All of the above
14) The term dequeue is the contraction of the name ……..
A. Double ended queue
B. Double sided queue
C. Double headed queue
D. Double address queue
15) The various operations that can be performed on stacks is/are …..
A. Insert an item into the stack
B. Delete an item from the stack
C. Display the contents of the stack
D. All of the above
16) …………. is a collection of elements such that each element has been
assigned a
processing priority.
A. Priority queue
B. Procedure queue
C. Main queue
D. Interrupt queue
17) The deletion operation in stack is called ……
A. insert
B. push
C. pop
D. top
18) Link fields holds pointers to the ………. element in the linked
representation of
stack.
A. Neighboring
B. Last
C. First
D. Middle
19) The pointer associated with the stack is ………..
A. front
B. rear
C. top
D. link
20) Reversing a great deal of space for each stack in memory will ………..
A. Decrease the numbers of times overflow may occur
B. Increase the numbers of times overflow may occur
C. Increase the number of times underflow may occur
D. Increase the number of times underflow may occur
Answers:
1) C. circular
2) A. Overflow
3) C. double-ended queue
4) B. Underflow
5) D. both the ends
6) A. Before insertion
7) C. priority
8) A. Node pointed by the start process
9) A. FIFO lists
10) A. Front=Null
11) B. Special queue
12) C. An element is added in a queue
13) D. All of the above
14) A. Double-ended queue
15) D. All of the above
16) A. Priority queue
17) C. pop
18) A. Neighboring
19) C. top
20) A. Decrease the numbers of times overflow may occur
Set 3
1. Which of the following is not the type of queue?
A) Ordinary queue
B) Single-ended queue
C) Circular queue
D) Priority queue
2. The property of a binary tree is
A) The first subset is called the left subtree
B) The second subtree is called right subtree
C) The root cannot contain NULL
D) The right subtree can be empty
3. State true or false.
i) The degree of root node is always zero.
ii) Nodes that are not root and not leaf are called as internal nodes.
A) True, True
B) True, False
C) False, True
D) False, False
4. Any node is the path from the root to the node is called
A) Successor node
B) Ancestor node
C) Internal node
D) None of the above
5. State true of false.
i) A node is a parent if it has successor nodes.
ii) A node is child node if out degree is one.
A) True, True
B) True, False
C) False, True
D) False, False
6. ………………. is not an operation performed on linear list
a) Insertion b) Deletion c) Retrieval d) Traversal
A) only a,b and c
B) only a and b
C) All of the above
D) None of the above
7. Which is/are the application(s) of stack
A) Function calls
B) Large number Arithmetic
C) Evaluation of arithmetic expressions
D) All of the above
8. A …………… is an acyclic digraph, which has only one node with
indegree 0, and
other nodes have in-degree 1.
A) Directed tree
B) Undirected tree
C) Dis-joint tree
D) Direction oriented tree
9. …………………. Is a directed tree in which out-degree of each node is less
than or
equal to two.
A) Unary tree
B) Binary tree
C) Trinary tree
D) Both B and C
10. State true or false.
i) An empty tree is also a binary tree.
ii) In strictly binary tree, the out-degree of every node is either o or 2.
A) True, False
B) False, True
C) True, True
D) False, False
11. Which of the following data structures are indexed structures?
A. Linear arrays
B. Linked lists
C. Queue
D. Stack
12. Which of the following data structure store the homogeneous data
elements?
A. Arrays
B. Records
C. Pointers
D. Lists
13. When new data are to be inserted into a data structure, but there is
not available
space; this situation is usually called ….
A. Underflow
B. overflow
C. houseful
D. saturated
14. A data structure where elements can be added or removed at either
end but not in
the middle is called …
A. linked lists
B. stacks
C. queues
D. dequeue
15. Operations on a data structure may be …..
A. creation
B. destruction
C. selection
D. all of the above
16. The way in which the data item or items are logically related defines
…..
A. storage structure
B. data structure
C. data relationship
D. data operation
17. Which of the following are the operations applicable an primitive
data structures?
A. create
B. destroy
C. update
D. all of the above
18. The use of pointers to refer elements of a data structure in which
elements are
logically adjacent is ….
A. pointers
B. linked allocation
C. stack
D. queue
19. Arrays are best data structures
A. for relatively permanent collections of data
B. for the size of the structure and the data in the structure are
constantly changing
C. for both of above situation
D. for non of above situation
20. Which of the following statement is false?
A. Arrays are dense lists and static data structure.
B. Data elements in linked list need not be stored in adjacent space in
memory
C. Pointers store the next data element of a list.
D. Linked lists are collection of the nodes that contain information part
and next
pointer.
Answers:
1. B) Single ended queue
2. D) The right ….. empty
3. C) False, True
4. B) Ancestor node
5. B) True, False
6. D) None of the above
7. D) All of the above
8. A) Directed tree
9. B) Binary tree
10. C) True, True
11. A. Linear arrays
12. B. Records
13. B. overflow
14. D. dequeue
15. D. all of the above
16. B. data structure
17. D. all of the above
18. B. linked allocation
19. A. for relatively permanent collections of data
20. C. Pointers store the next data element of a list.
Solved MCQ on Data Structure and Algorithm set-4
This set of MCQ on data structure and algorithm includes solved
multiple-choice
questions about linear and non-linear types of data structure, array and
linear arrays. It
also includes objective questions about indexed structures, nodes in a
linked list and
linear array.
1. Which of the following data structure is non-linear type?
A) Strings
B) Lists
C) Stacks
D) Tree
2. Which of the following data structure is linear type?
A) Array
B) Tree
C) Graphs
D) Hierarchy
3. The logical or mathematical model of a particular organization of data
is called a
………
A) Data structure
B) Data arrangement
C) Data configuration
D) Data formation
4. The simplest type of data structure is ………………
A) Multidimensional array
B) Linear array
C) Two-dimensional array
D) Three-dimensional array
5. Linear arrays are also called ……………….
A) Straight line array
B) One-dimensional array
C) Vertical array
D) Horizontal array
6. Arrays are best data structures …………
A) For relatively permanent collections of data.
B) For the size of the structure and the data in the structure are
constantly changing
C) For both of above situation
D) For none of the above
7. Which of the following data structures are indexed structures?
A) Linear arrays
B) Linked lists
C) Graphs
D) Trees
8. Each node in a linked list has two pairs of ………….. and ……………….
A) Link field and information field
B) Link field and avail field
C) Avail field and information field
D) Address field and link field
9. A …………………… does not keep track of address of every element in
the list.
A) Stack
B) String
C) Linear array
D) Queue
10. When does top value of the stack changes?
A) Before deletion
B) While checking underflow
C) At the time of deletion
D) After deletion
Answers:
1. Which of the following data structure is non-linear type?
D) Tree
2. Which of the following data structure is linear type?
A) Array
3. The logical or mathematical model of a particular organization of data
is called a
………
A) Data structure
4. The simplest type of data structure is ………………
B) Linear array
5. Linear arrays are also called ……………….
B) One-dimensional array
6. Arrays are best data structures …………
A) For relatively permanent collections of data.
7. Which of the following data structures are indexed structures?
A) Linear arrays
8. Each node in a linked list has two pairs of ………….. and ……………….
A) Link field and information field
9. A …………………… does not keep track of address of every element in
the list.
C) Linear array
10. When does top value of the stack changes?
D) After deletion
Set 5
1. Arrays are best data structures
A) for relatively permanent collections of data
B) for the size of the structure and the data in the structure are
constantly
changing
C) for both of above situation
D) for none of above situation
2. Which of the following data structure is not linear data structure?
A) Arrays
B) Linked lists
C) Both of the above
D) None of the above
3. The disadvantage in using a circular linked list is …………………….
A) It is possible to get into infinite loop.
B) Last node points to first node.
C) Time consuming
D) Requires more memory space
4. A linear list in which each node has pointers to point to the
predecessor and
successors nodes is called as ..
A) Singly Linked List
B) Circular Linked List
C) Doubly Linked List
D) Linear Linked List
5. A ……………….. is a linear list in which insertions and deletions are made
to from either end of the structure.
A) circular queue
B) random of queue
C) priority
D) dequeue
6. In a priority queue, insertion and deletion takes place at ………………
A) front, rear end
B) only at rear end
C) only at front end
D) any position
7. The time complexity of quick sort is …………..
A) O(n)
B) O(n2)
C) O(n log n)
D) O(log n)
8. Which of the following is an application of stack?
A) finding factorial
B) tower of Hanoi
C) infix to postfix conversion
D) all of the above
9. The data structure which is one ended is ………………
A) queue
B) stack
C) tree
D) graph
10. A list which displays the relationship of adjacency between elements
is
said to be
A) linear
B) non linear
C) linked list
D) trees
Answers:
1. Arrays are best data structures
A) for relatively permanent collections of data
2. Which of the following data structure is not linear data structure?
D) None of the above
3. The disadvantage in using a circular linked list is …………………….
A) It is possible to get into infinite loop.
4. A linear list in which each node has pointers to point to the
predecessor and
successors nodes is called as ..
C) Doubly Linked List
5. A ……………….. is a linear list in which insertions and deletions are made
to from either end of the structure.
D) dequeue
6. In a priority queue, insertion and deletion takes place at ………………
D) any position
7. The time complexity of quick sort is …………..
C) O(n log n)
8. Which of the following is an application of stack?
D) all of the above
9. The data structure which is one ended is ………………
B) stack
10. A list which displays the relationship of adjacency between elements
is
said to be
A) linear
Set 6
1. …………………….. is a variable that can hold the address of the variables,
structure
and functions that are used in the program.
A) Array
B) Pointer
C) Structure
D) None of the above
2. ……………… is the organization of the data in a computers memory or in
a file.
A) Array
B) Data Structure
C) Data Management
D) Data Organization
3. Which of the following is/are the advantages of using an array?
i) Multi huge quantity of data items can be stored.
ii) Arrays saves the memory space
iii) Arrays helps to arrange the data items in particular order.
iv) Data item searching is faster.
A) i, ii and iii only
B) ii, iii and iv only
C) i, iii and iv only
D) All i, ii, iii and iv
4. Some examples of data structures are
i) array
ii) stack
iii) queue
iv) binary tree
v) hybrid tree
A) i, ii, iii and iv only
B) ii, iii, iv and v only
C) i, ii, iii and v only
D) All i, ii, iii, iv and v
Table of Contents
Read Also: Objective Questions on Data Structure and Algorithm
5. Match the following components of data structure based on the
concept of
Abstract Data Type (ADT) with their definitions.
a) Operations i) Organizations of data implemented in lower level data
structure.
b) Storage structures ii) Description on how to manipulate information in
the
storage structure.
c) Algorithms iii) Specifies the external appearance of data structure.
A) a-i, b-ii, c-iii
B) a-ii, b-iii, c-i
C) a-iii, b-i, c-ii
D) a-i, b-iii, c-ii
6. Match the following properties of an array with their descriptions.
a) Homogeneous i) the list size is constant.
b) Ordered ii) there is a first and last element.
c) Finite iii) there is a next and previous in the natural order of the
structure
d) fixed-length iv) every element is the same.
A) a-i, b-ii, c-iii, d-iv
B) a-ii, b-iii, c-iv, d-i
C) a-iii, b-i, c-ii, d-iii
D) a-iv, b-iii, c-ii, d-i
7. Which of the following are linear type of data structure?
i) Linked list
ii) Stack
iii) Binary Tree
iv) Array
v) Queue
A) i, ii, iii and iv only
B) ii, iii, iv and v only
C) i, ii, iv and v only
D) All i, ii, iii, iv and v
8. Which of the following are non linear type of data structure?
i) Tree
ii) Graphs
iii) Hash tables
iv) List
A) i, ii and iii only
B) ii, iii and iv only
C) i, iii and iv only
D) All i, ii, iii and iv
Read Also: Objective questions of computer data structure
9. State whether the following statements is/are True or False.
i) An ancestor is any node in the path from the root to the node.
ii) A sub-tree is any connected structure below the root.
iii) Binary tree is a directed tree in which out degree of each node is less
than or equal
to one.
iv) A tree consists of finite set of elements called nodes.
v) Nodes that are not root and not leaf are called intermediate nodes.
A) True, True, True, False, True
B) True, False, True, True, False
C) True, True, True, False, False
D) True, True, False, True, False
10. In a binary search tree the node to be deleted will have two cases
which are
i) An empty left sub-tree and non empty right sub-tree and vice versa.
ii) Non empty left sub-tree and right sub-tree.
iii) Empty left sub-tree and right sub-tree.
A) i and ii only
B) ii, and iii only
C) i and iii only
D) None of the above
Ezoic
Answers:
1. B) Pointer
2. B) Data Structure
3. D) All i, ii, iii and iv
4. A) i, ii, iii and iv only
5. C) a-iii, b-i, c-ii
6. D) a-iv, b-iii, c-ii, d-i
7. C) i, ii, iv and v only
8. A) i, ii and iii only
9. D) True, True, False, True, False
10. A) i and ii only
LIST
Q1.node.next -> node.next.next; will make
a.node.next inaccessible
b.node.next.next inaccessible
c.this node inaccessible
d.none of the above
Answer: (a).node.next inaccessible
Q2.A circular linked list can be used for
a.Stack
b.Queue
c.Both Stack & Queue
d.Neither Stack or Queue
Answer: (c).Both Stack & Queue
Q3.In doubly linked lists
a.a pointer is maintained to store both next and previous nodes.
b.two pointers are maintained to store next and previous nodes.
c.a pointer to self is maintained for each node.
d.none of the above.
Answer: (b).two pointers are maintained to store next and previous
nodes.
Q4.………… is very useful in situation when data have to stored and
then retrieved in reverse order.
a.Stack
b.Queue
c.List
d.Link list
Answer: (a).Stack
Q5.The advantage of …………….. is that they solve the problem if
sequential storage representation. But disadvantage in that is they are
sequential lists.
a.Lists
b.Linked Lists
c.Trees
d.Queues
Answer: (b).Linked Lists
Q6.There is an extra element at the head of the list called a ……….
a.Antinel
b.Sentinel
c.List header
d.List head
Answer: (b).Sentinel
Q7.Each node in a linked list has two pairs of ………….. and ……………….
a.Link field and information field
b.Link field and avail field
c.Avail field and information field
d.Address field and link field
Answer: (a).Link field and information field
Q8.The disadvantage in using a circular linked list is …………………….
a.It is possible to get into infinite loop
b.Last node points to first node.
c.Time consuming
d.Requires more memory space
Answer: (a).It is possible to get into infinite loop
Q9.
A linear list in which each node has pointers to point to the
predecessor and successors nodes is called as
a.Singly Linked List
b.Circular Linked List
c.Doubly Linked List
d.Linear Linked List
Answer: (c).Doubly Linked List
Q10.
Linked lists are best suited
a.for relatively permanent collections of data
b.for the size of the structure and the data in the structure are
constantly changing
c.for both of above situation
d.for none of above situation
Answer: (b).for the size of the structure and the data in the structure are
constantly changing
Q11.
The situation when in a linked list START=NULL is
a.underflow
b.overflow
c.housefull
d.saturated
Answer: (a).underflow
Q12.Which of the following is two way list?
a.grounded header list
b.circular header list
c.linked list with header and trailer nodes
d.none of above
Answer: (d).none of above
Q13.In a circular linked list
a.Components are all linked together in some sequential manner.
b.There is no beginning and no end.
c.Components are arranged hierarchically.
d.Forward and backward traversal within the list is permitted.
Answer: (b).There is no beginning and no end.
Q14.A linear collection of data elements where the linear node is given
by means of pointer is called?
a.Linked list
b.Node list
c.Primitive list
d.None of the above
Answer: (a).Linked list
Q15.Which of the following operations is performed more efficiently
by doubly linked list than by singly linked list?
a.Deleting a node whose location in given
b.Searching of an unsorted list for a given item
c.Inverting a node after the node with given location
d.Traversing a list to process each node
Answer: (a).Deleting a node whose location in given
Q16.What would be the asymptotic time complexity to add a node at
the end of singly linked list, if the pointer is initially pointing to the
head of the list?
a.O(1)
b.O(n)
c.θ (n)
d.θ (1)
Answer: (c).θ (n)
Q17.A variant of linked list in which last node of the list points to the
first node of the list is?
a.Singly linked list
b.Doubly linked list
c.Circular linked list
d.Multiply linked list
Answer: (c).Circular linked list
Q18.In doubly linked lists, traversal can be performed?
a.Only in forward direction
b.Only in reverse direction
c.In both directions
d.None of the above
Answer: (c).In both directions
Q19.What kind of linked list is best to answer question like “What is
the item at position n?”
a.Singly linked list
b.Doubly linked list
c.Circular linked list
d.Array implementation of linked list
Answer: (d).Array implementation of linked list
Q20.A variation of linked list is circular linked list, in which the last
node in the list points to first node of the list. One problem with this
type of list is?
a.It waste memory space since the pointer head already points to the
first node and thus the list node does not need to point to the first node.
b.It is not possible to add a node at the end of the list.
c.It is difficult to traverse the list as the pointer of the last node is now
not NULL
d.All of above
Answer: (c).It is difficult to traverse the list as the pointer of the last
node is now not NULL
Q21.A variant of the linked list in which none of the node contains
NULL pointer is?
a.Singly linked list
b.Doubly linked list
c.Circular linked list
d.None of the above
Answer: (c).Circular linked list
Q22.In circular linked list, insertion of node requires modification of?
a.One pointer
b.Two pointer
c.Three pointer
d.Requires no modification
Answer: (b).Two pointer
Q23.Consider a linked list of n elements. What is the time taken to
insert an element after an element pointed by some pointer?
a.O (1)
b.O (log n)
c.O (n)
d.O (n log n)
Answer: (a).O (1)
Q24.In a linked list with n nodes, the time taken to insert an element
after an element pointed by some pointer is
a.0 (1)
b.0 (log n)
c.0 (n)
d.0 (n log n)
Answer: (a). 0 (1)
Q25.A linear collection of data elements where the linear node is given
by means of pointer is called
a.linked list
b.node list
c.primitive list
d.None of these
Answer: (a).linked list
Q26.The time required to delete a node x from a doubly linked list
having n nodes is
a.O (n)
b.O (log n)
c.O (1)
d.O (n log n)
Answer: (c).O (1)
Q27.
A collection of data items of similar type arranged in a sequence is
termed as?
a.Memory space
b.Static data structure
c.Data structure
d.List
Answer: (d).List
Q28.A linked list is a linear collection of homogeneous elements
called______.
a.Runtime
b.Nodes
c.Pointers
d.None of the above
Answer: (b).Nodes
Q29.Depending on what on what can a linked list be classified into
various other types?
a.The number of pointers in a node
b.The purpose for which the pointers are maintained
c.Both (a) and (b)
d.None of the above
Answer: (c).Both (a) and (b)
Q30.In a singly-linked list (linear linked list), how many fields does each
node consists of?
a.One
b.Three
c.Two
d.Zero
Answer: (c).Two