R4RIN
Articles
Java 8
MCQS
Data structure MCQ Quiz Hub
Data Structure (DS) MCQ Set 1
Choose a topic to test your knowledge and improve your Data structure skills
1. Which if the following is/are the levels of implementation of data structure
abstract level
application level
implementation level
all of the above
2. A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……
avl tree
red-black tree
lemma tree
None of the above
3. A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called …… D. none of the above
. avl tree
red-black tree
lemma tree
None of the above
4. Stack is also called as
last in first out
first in last out
last in last out
first in first out
5. …………… is not the component of data structure.
operations
storage structures
algorithms
None of the above
6. Which of the following is not the part of ADT description?
data
operations
both of the above
None of the above
7. ……. Is a pile in which items are added at one end and removed from the other.
stack
queue
list
None of the above
8. Which data structure allows deleting data elements from and inserting at rear?
stacks
queues
dequeues
binary search tree
9. A ……. is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
queue linked list
stacks linked list
both of them
neither of them
10. Which of the following is non-liner data structure?
stacks
list
strings
trees
11. Herder node is used as sentinel in …..
graphs
stacks
binary tree
queues
12. Which data structure is used in breadth first search of a graph to hold nodes?
stack
queue
tree
array
13. Which data structure is used in breadth first search of a graph to hold nodes?
stack
queue
tree
array
14. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
input restricted dequeue
output restricted qequeue
output restricted qequeue
stack
15. Which of the following data structure is non linear type?
strings
lists
stacks
graph
16. Which of the following data structure is linear type?
graph
trees
binary tree
stack
17. To represent hierarchical relationship between elements, Which data structure is suitable?
dequeue
priority
tree
graph
18. A directed graph is ………………. if there is a path from each vertex to every other vertex in the digraph.
weakly connected
strongly connected
tightly connected
linearly connected
19. In the …………….. traversal we process all of a vertex’s descendants before we move to an adjacent vertex.
depth first
breadth first
with first
depth limited
20. The number of comparisons done by sequential search is ………………
(n/2)+1
(n+1)/2
(n-1)/2
(n+2)/2
21. In ……………, search start at the beginning of the list and check every element in the list.
linear search
binary search
hash search
binary tree search
22. Which of the following is not the internal sort?
insertion sort
bubble sort
merge sort
heap sort
23. A graph is said to be ……………… if the vertices can be split into two sets V1 and V2 such there are no edges between two vertices of V1 or two vertices of V2.
partite
bipartite
rooted
bisects
24. In a queue, the initial values of front pointer f rare pointer r should be …….. and ……….. respectively.
0 and 1
0 and -1
-1 and 0
1 and 0
25. In a circular queue the value of r will be ..
r=r+1
r=(r+1)% [queue_size – 1]
r=(r+1)% queue_size
r=(r-1)% queue_size
26. The advantage of …………….. is that they solve the problem if sequential storage representation. But disadvantage in that is they are sequential lists.
lists
linked lists
trees
queues
27. …… is not the operation that can be performed on queue.
insertion
deletion
retrieval
traversal
28. There is an extra element at the head of the list called a ……….
antinel
sentinel
list header
list head
29. ……… is not the operation that can be performed on queue.
insertion
deletion
retrieval
traversal
30. A graph is a collection of nodes, called ………. And line segments called arcs or ……….. that connect pair of nodes.
antinel
sentinel
ist header
list head
31. A ……….. is a graph that has weights of costs associated with its edges.
network
weighted graph
both a and b
none a and b
32. In general, the binary search method needs no more than ……………. comparisons.
[log2n]-1
logn]+1
[log2n]
[log2n]+1
33. The property of binary tree is
the first subset is called left subtree
the second subtree is called right subtree
the root cannot contain null
the right subtree can be empty
34. Any node is the path from the root to the node is called
successor node
ancestor node
internal node
None of the above
35. Which is/are the application(s) of stack
function calls
large number arithmetic
evaluation of arithmetic expressions
All of the above
36. A …………… is an acyclic digraph, which has only one node with indegree 0, and other nodes have in-degree 1.
directed tree
undirected tree
dis-joint tree
direction oriented tree
37. ……. Is a directed tree in which outdegree of each node is less than or equal to two.
unary tree
binary tree
trinary tree
both b and c
38. Which of the following data structure is non-linear type?
strings
lists
stacks
tree
39. Which of the following data structure is linear type?
array
tree
graphs
hierarchy
40. The logical or mathematical model of a particular organization of data is called a ………
data structure
data arrangement
data configuration
data formation
41. The simplest type of data structure is ………………
multidimensional array
linear array
two dimensional array
three dimensional array
42. Linear arrays are also called ……………….
straight line array
one-dimensional array
vertical array
horizontal array
43. Arrays are best data structures …………
for relatively permanent collections of data
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of the above
44. Which of the following data structures are indexed structures?
linear arrays
linked lists
graphs
trees
45. Each node in a linked list has two pairs of ………….. and ……………….
link field and information field
link field and avail field
avail field and information field
address field and link field
46. A …………………… does not keep track of address of every element in the list.
stack
string
linear array
queue
47. When does top value of the stack changes?
before deletion
while checking underflow
at the time of deletion
after deletion
48. Arrays are best data structures …………
for relatively permanent collections of data.
for the size of the structure and the data in the structure are constantly changing
for both of above situation
for none of the above
49. fThe disadvantage in using a circular linked list is …………………….
it is possible to get into infinite loop.
last node points to first node
time consuming
requires more memory space
50. A linear list in which each node has pointers to point to the predecessor and successors nodes is called as ..
singly linked list
circular linked list
doubly linked list
linear linked list
51. A ……………….. is a linear list in which insertions and deletions are made to from either end of the structure.
circular queue
random of queue
priority
dequeue
52. In a priority queue, insertion and deletion takes place at ………………
front, rear end
only at rear end
only at front end
any position
53. The time complexity of quick sort is …………..
o(n)
o(n2)
o(n log n)
o(log n)
54. Which of the following is an application of stack?
finding factorial
tower of hanoi
infix to postfix conversion
all of the above
55. The data structure which is one ended is ………………
queue
stack
tree
graph
56. A list which displays the relationship of adjacency between elements is said to be
linear
non linear
linked list
trees
57. ……….. level is where the model becomes compatible executable code
abstract level
application level
implementation level
All of the above
58. Inserting an item into the stack when stack is not full is called …………. Operation and deletion of item form the stack, when stack is not empty is called ………..operation.
push, pop
pop, push
insert, delete
delete, insert
59. Each array declaration need not give, implicitly or explicitly, the information about
the name of array
the data type of array
. the first data from the set to be stored
the index set of the array
60. Finding the location of the element with a given value is:
traversal
search
sort
None of the above
61. Which of the following statement is true?i) Using singly linked lists and circular list, it is not possible to traverse the list backwards.ii) To find the predecessor, it is required to traverse the list from the first node in case of singly linked list.
i-only
ii-only
both i and ii
None of the above
62. What will be the value of top, if there is a size of stack STACK_SIZE is 5
5
6
4
None of the above
63. …… is not the operation that can be performed on queue.
insertion
deletion
retrieval
traversal
64. A data structure where elements can be added or removed at either end but not in the middle is called …
linked lists
stacks
queue
dequeue
65. The term "push" and "pop" is related to the
array
lists
stacks
all of the above
66. Which data structure allows deleting data elements from front and inserting at rear?
stacks
queue
dequeue
binary search tree
67. node.next -> node.next.next; will make
node.next inaccessible
node.next.next inaccessible
this node inaccessible
None of the above
68. A circular linked list can be used for
stack
queue
both stack & queue
neither stack or queue
69. In doubly linked lists
a pointer is maintained to store both next and previous nodes.
two pointers are maintained to store next and previous nodes.
a pointer to self is maintained for each node.
none of the above
70. The disadvantage in using a circular linked list is …………………….
A. it is possible to get into infinite loop
last node points to first node
time consuming
requires more memory space
71. In doubly linked lists, traversal can be performed?
only in forward direction
only in reverse direction
in both directions
none of the above
72. What differentiates a circular linked list from a normal linked list?
you cannot have the ‘next’ pointer point to null in a circular linked list
it is faster to traverse the circular linked list
you may or may not have the ‘next’ pointer point to null in a circular linked list
head node is known in circular linked list
73. How do you count the number of elements in the circular linked list?
public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != head){temp = temp.getnext();length++;}return length;}
public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != null){temp = temp.getnext();length++;}return length;}
public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != head && temp != null){temp = head.getnext();length++;}return length;}
public int length(node head){int length = 0;if( head == null)return 0;node temp = head.getnext();while(temp != head && temp == null){temp = head.getnext();length++;}return length;}
74. What is a dequeue?
a queue with insert/delete defined for both front and rear ends of the queue
a queue implemented with a doubly linked list
a queue implemented with both singly and doubly linked lists
a queue with insert/delete defined for front side of the queue
75. Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
full: (rear+1) mod n == front, empty: rear == front
full: (rear+1) mod n == front, empty: (front+1) mod n == rear
full: rear == front, empty: (rear+1) mod n == front
full: (front+1) mod n == rear, empty: rear == front
Submit