550+ DataStructure CCEE MCQ
550+ DataStructure CCEE MCQ
Sr.No
Project Name YouTube Link
11 Tour and Travel System Project version 3.0 https://youtu.be/Dm7nOdpasWg?si=P_Lh2gcOFhlyudug
12 Gym Management system Project https://youtu.be/J8_7Zrkg7ag?si=LcxV51ynfUB7OptX
13 Online Driving License system Project https://youtu.be/3yRzsMs8TLE?si=JRI_z4FDx4Gmt7fn
14 Online Flight Booking system Project https://youtu.be/m755rOwdk8U?si=HURvAY2VnizIyJlh
15 Employee management system project https://youtu.be/lD1iE3W_GRw?si=Y_jv1xV_BljhrD0H
16 Online student school or college portal https://youtu.be/4A25aEKfei0?si=RoVgZtxMk9TPdQvD
17 Online movie booking system project https://youtu.be/Lfjv_U74SC4?si=fiDvrhhrjb4KSlSm
18 Online Pizza Delivery system project https://youtu.be/Tp3izreZ458?si=8eWAOzA8SVdNwlyM
19 Online Crime Reporting system Project https://youtu.be/0UlzReSk9tQ?si=6vN0e70TVY1GOwPO
20 Online Children Adoption Project https://youtu.be/3T5HC2HKyT4?si=bntP78niYH802I7N
pg. 4 contact us on 8007592194 / 9284926333 www.codewitharrays.in
Chapter: Linear Data Structures - List
B. int arr[];
A. int[] arr;
B. int arr[[]];
C. int[][]arr;
D. int[[]] arr;
Answer» C. int[][]arr;
discuss
A. Compile-time
Answer» B. Run-time
5. When does the ArrayIndexOutOfBoundsException occur?
B. Run-time
C. Not an error
Answer» B. Run-time
discuss
A. Binary trees
B. Scheduling of processes
C. Caching
D. Spatial locality
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
Answer» B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
discuss
A. 15
B. 19
C. 11
D. 60
Answer» D. 60
discuss
A. 0
B. -1
C. 2
D. 1
Answer» A. 0
discuss
A. randomly
B. sequentially
C. exponentially
D. logarithmically
Answer» A. randomly
discuss
A. Fixed size
B. There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
13. What is the time complexity of inserting at the end in dynamic arrays?
A. O(1)
B. O(n)
C. O(logn)
Answer» D. Implementing a doubly linked list is easier than singly linked list
discuss
16. What is the worst case time complexity of inserting a node in a doubly linked list?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer» C. O(n)
discuss
17. Which of the following application makes use of a circular linked list?
B. Time complexity of inserting a new node at the head of the list is O(1)
D. We can traverse the whole circular linked list by starting from any point
Answer» B. Time complexity of inserting a new node at the head of the list is O(1)
discuss
19. 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. Unordered list
20. In linked list each node contain minimum of two fields. One field is data field to store the data second field
is?
A. Pointer to character
B. Pointer to integer
C. Pointer to node
D. Node
A. O(1)
B. O(n)
C. θ(n)
D. θ(1)
Answer» C. θ(n)
discuss
22. The concatenation of two list can performed in O(1) time. Which of the following variation of linked list can
be used?
A. ptr = (NODE*)malloc(sizeof(NODE));
B. ptr = (NODE*)malloc(NODE);
C. ptr = (NODE*)malloc(sizeof(NODE*));
D. ptr = (NODE)malloc(sizeof(NODE));
A. Create
B. Push
C. Evaluation
D. Pop
Answer» B. Push
discuss
25. Process of removing an element from stack is called
A. Create
B. Push
C. Evaluation
D. Pop
Answer» D. Pop
discuss
26. In a stack, if a user tries to remove an element from empty stack it is called
A. Underflow
B. Empty collection
C. Overflow
D. Garbage Collection
Answer» A. Underflow
discuss
27. Pushing an element into stack already having five elements and stack size of 5, then stack becomes
A. Overflow
B. Crash
C. Underflow
D. User flow
Answer» A. Overflow
discuss
28. Entries in a stack are “ordered”. What is the meaning of this statement?
30. Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Suppose that
you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some
order). The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the
computation?
A. 1
B. 2
C. none
D. none
Answer» B. 2
discuss
A. 1
B. 40
C. 74
D. -18
Answer» D. -18
discuss
32. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
B. AB + CD* E – F **G /
C. AB + CD* E – *F *G /
Answer» C. AB + CD* E – *F *G /
32. The postfix form of the expression (A+ B)*(C*D- E)*F / G is?
D. AB + CDE * – * F *G /
Answer» C. AB + CD* E – *F *G /
discuss
33. The data structure required to check whether an expression contains balanced parenthesis is?
A. Stack
B. Queue
C. Array
D. Tree
Answer» A. Stack
discuss
34. What data structure would you mostly likely see in a non recursive implementation of a recursive
algorithm?
A. Linked List
B. Stack
C. Queue
D. Tree
Answer» B. Stack
discuss
35. The process of accessing data stored in a serial access memory is similar to manipulating data on a
A. Heap
B. Binary Tree
C. Array
D. Stack
Answer» D. Stack
discuss
36. The postfix form of A*B+C/D is?
A. *AB/CD+
B. AB*CD/+
C. A*BC+/D
D. ABCD+/*
Answer» B. AB*CD/+
discuss
37. Which data structure is needed to convert infix notation to postfix notation?
A. Branch
B. Tree
C. Queue
D. Stack
Answer» D. Stack
discuss
A. -/*^ACBDE
B. -ABCD*^DE
C. -A/B*C^DE
D. -A/BC*^DE
Answer» C. -A/B*C^DE
discuss
39. What is the result of the following operation? Top (Push (S, X))
A. X
B. X+S
Answer» A. X
39. What is the result of the following operation? Top (Push (S, X))
C. S
D. none
Answer» A. X
discuss
A. + pq – *rt
B. – +pqr * t
C. – +pq * rt
D. – + * pqrt
Answer» C. – +pq * rt
discuss
A. Queue
B. Stack
C. Array
D. List
Answer» B. Stack
discuss
C. It is ignored
A. It is ignored
A. (a+b)*(c+d)
B. ab+c*
C. +ab
D. abc+*
Answer» A. (a+b)*(c+d)
discuss
A. O(N log N)
B. O(N)
C. O(N2)
D. O(M log N)
Answer» B. O(N)
discuss
46. Which of the following statement is incorrect with respect to infix to postfix conversion algorithm?
B. operator is placed in the stack when the stack operator has lower precedence
47. In infix to postfix conversion algorithm, the operators are associated from?
A. right to left
B. left to right
C. centre to left
D. centre to right
48. A linear list of elements in which deletion can be done from one end (front) and insertion can take place
only at the other end (rear) is known as a ?
A. Queue
B. Stack
C. Tree
D. Linked list
Answer» A. Queue
discuss
49. The data structure required for Breadth First Traversal on a graph is?
A. Stack
B. Array
C. Queue
D. Tree
Answer» C. Queue
discuss
C. Ordered array
D. Linear tree
A. Ring Buffer
B. Square Buffer
C. Rectangle Buffer
D. Curve Buffer
52. If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will
they be removed?
A. ABCD
B. DCBA
C. DCAB
D. ABDC
Answer» A. ABCD
discuss
53. A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle
is?
A. Queue
B. Circular queue
C. Dequeue
D. Priority queue
Answer» C. Dequeue
discuss
54. A normal queue, if implemented using an array of size MAX_SIZE, gets full when
A. Rear = MAX_SIZE – 1
C. Front = rear + 1
D. Rear = front
A. Simulation of recursion
A. Ordinary queue
C. Circular queue
D. Priority queue
A. Array
B. List
C. Heap
D. Tree
Answer» D. Tree
discuss
A. Huffman codes
59. What is the time complexity to insert a node based on key in a priority queue?
A. O(nlogn)
B. O(logn)
Answer» C. O(n)
59. What is the time complexity to insert a node based on key in a priority queue?
C. O(n)
D. O(n2)
Answer» C. O(n)
discuss
A. A low priority process might have to wait indefinitely for the CPU
B. If the system crashes, the low priority systems may be lost permanently
C. Interrupt handling
D. Indefinite blocking
A. Easy to implement
62. What is the time complexity to insert a node based on position in a priority queue?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» C. O(n)
discuss
A. A queue with insert/delete defined for both front and rear ends of the queue
Answer» A. A queue with insert/delete defined for both front and rear ends of the queue
discuss
64. What are the applications of dequeue?
66. In a circular queue, how do you increment the rear end of the queue?
A. rear++
B. (rear+1) % CAPACITY
C. (rear % CAPACITY)+1
D. rear–
67. What is the term for inserting into a full queue known as?
A. overflow
B. underflow
Answer» A. overflow
discuss
B. easier computations
A. O(n)
B. O(nlogn)
C. O(logn)
D. O(1)
Answer» A. O(n)
discuss
70. What is the maximum number of children that a binary tree node can have?
A. 0
B. 1
C. 2
D. 3
Answer» C. 2
discuss
A. Binary tree
D. none
A. 1
B. 2
C. 3
D. 4
Answer» C. 3
discuss
A. depth-first traversal
B. breadth-first traversal
C. random traversal
D. Priority traversal
A. 1
B. 2
C. 3
D. 4
Answer» B. 2
discuss
75. What operation does the following diagram depict?
D. none
A. n+O(n)
B. 2n+O(n)
C. n/2
D. n
Answer» B. 2n+O(n)
discuss
A. O(N)
B. O(√N)
C. O(N2)
D. O(log N)
Answer» D. O(log N)
discuss
78. How many orders of traversal are applicable to a binary tree (In General)? 3
A. 1
B. 4
C. 2
Answer» D. 3
78. How many orders of traversal are applicable to a binary tree (In General)? 3
D. 3
Answer» D. 3
discuss
79. If binary trees are represented in arrays, what formula can be used to locate a left child, if the node has an
index i?
A. 2i+1
B. 2i+2
C. 2i
D. 4i
Answer» A. 2i+1
discuss
A. (i+1)/2
B. (i-1)/2
C. i/2
D. 2i/2
Answer» B. (i-1)/2
discuss
81. Which of the following properties are obeyed by all three tree – traversals?
A. 2, 7, 2, 6, 5, 11, 5, 9, 4
B. 2, 7, 5, 2, 6, 9, 5, 11, 4
C. 2, 5, 11, 6, 7, 4, 9, 5, 2
D. none
Answer» A. 2, 7, 2, 6, 5, 11, 5, 9, 4
discuss
83. For the tree below, write the post-order traversal.
A. 2, 7, 2, 6, 5, 11, 5, 9, 4
B. 2, 7, 5, 2, 6, 9, 5, 11, 4
C. 2, 5, 11, 6, 7, 4, 9, 5, 2
D. none
Answer» C. 2, 5, 11, 6, 7, 4, 9, 5, 2
discuss
84. What is the time complexity of pre-order traversal in the iterative fashion?
A. O(1)
B. O(n)
C. O(logn)
D. O(nlogn)
Answer» B. O(n)
discuss
85. What is the space complexity of the post-order traversal in the recursive fashion? (d is the tree depth and n
is the number of nodes)
A. O(1)
B. O(nlogd)
C. O(logd)
D. O(d)
Answer» D. O(d)
discuss
A. Level-order traversal
B. Pre-order traversal
C. Post-order traversal
D. In-order traversal
87. Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of
the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is
A. A, C, D, B, E
Answer» B. A, B, C, D, E
87. Consider the following data. The pre order traversal of a binary tree is A, B, E, C, D. The in order traversal of
the same binary tree is B, E, A, D, C. The level order sequence for the binary tree is
B. A, B, C, D, E
C. A, B, C, E, D
D. D, B, E, A, C
Answer» B. A, B, C, D, E
discuss
88. What is the possible number of binary trees that can be created with 3 nodes, giving the sequence N, M, L
when traversed in post-order.
A. 15
B. 3
C. 5
D. 8
Answer» C. 5
discuss (1)
89. The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be
A. T Q R S O P
B. T O Q R P S
C. T Q O P S R
D. T Q O S P R
Answer» C. T Q O P S R
discuss
90. A binary search tree contains values 7, 8, 13, 26, 35, 40, 70, 75. Which one of the following is a valid post-
order sequence of the tree provided the pre-order sequence as 35, 13, 7, 8, 26, 70, 40 and 75?
91. Which of the following pair’s traversals on a binary tree can build the tree uniquely?
B. pre-order traversal
C. post-order traversal
D. in-order traversal
93. The maximum number of nodes in a tree for which post-order and pre-order traversals may be equal is
A. 3
B. 1
C. 2
D. any number
Answer» B. 1
discuss
94. The pre-order and in-order are traversals of a binary tree are T M L N P O Q and L M N T O P Q. Which of
following is post-order traversal of the tree?
A. L N M O Q P T
B. N M O P O L T
C. L M N O P Q T
D. O P L M N Q T
Answer» A. L N M O Q P T
discuss
95. Find the postorder traversal of the binary tree shown below.
A. P Q R S T U V W X
B. W R S Q P V T U X
C. S W T Q X U V R P
Answer» C. S W T Q X U V R P
95. Find the postorder traversal of the binary tree shown below.
D. none
Answer» C. S W T Q X U V R P
discuss
A. 6, 2, 5, 7, 11, 2, 5, 9, 4
B. 6, 5, 2, 11, 7, 4, 9, 5, 2
C. 2, 7, 2, 6, 5, 11, 5, 9, 4
D. none
Answer» A. 6, 2, 5, 7, 11, 2, 5, 9, 4
discuss
A. 2, 7, 2, 6, 5, 11, 5, 9, 4
B. 2, 7, 5, 2, 11, 9, 6, 5, 4
C. 2, 5, 11, 6, 7, 4, 9, 5, 2
D. none
Answer» B. 2, 7, 5, 2, 11, 9, 6, 5, 4
discuss
98. What is the space complexity of the in-order traversal in the recursive fashion? (d is the tree depth and n is
the number of nodes)
A. O(1)
B. O(nlogd)
C. O(logd)
D. O(d)
Answer» D. O(d)
discuss
A. O(1)
B. O(n)
C. O(logn)
D. O(nlogn)
Answer» B. O(n)
discuss
100. Which of the following graph traversals closely imitates level order traversal of a binary tree?
D. Binary Search
101. In a binary search tree, which of the following traversals would print the numbers in the ascending order?
A. Level-order traversal
B. Pre-order traversal
C. Post-order traversal
D. In-order traversal
102. The number of edges from the root to the node is called of the tree.
A. Height
B. Depth
C. Length
D. Width
Answer» B. Depth
discuss
103. The number of edges from the node to the deepest leaf is called of the tree.
A. Height
B. Depth
C. Length
D. Width
Answer» A. Height
discuss
B. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from right to left
C. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to right
Answer» C. A binary tree, which is completely filled, with the possible exception of the bottom level, which is filled from left to
right
discuss
106. What is the average case time complexity for finding the height of the binary tree?
A. h = O(loglogn)
B. h = O(nlogn)
C. h = O(n)
D. h = O(log n)
Answer» D. h = O(log n)
discuss
A. Hierarchical structure
B. Faster search
C. Router algorithms
108. In a full binary tree if number of internal nodes is I, then number of leaves L are?
A. L = 2*I
B. L = I + 1
C. L = I – 1
D. L = 2*I – 1
Answer» B. L = I + 1
discuss
109. In a full binary tree if number of internal nodes is I, then number of nodes N are?
A. N = 2*I
B. N = I + 1
Answer» D. N = 2*I + 1
109. In a full binary tree if number of internal nodes is I, then number of nodes N are?
C. N = I – 1
D. N = 2*I + 1
Answer» D. N = 2*I + 1
discuss
110. In a full binary tree if there are L leaves, then total number of nodes N are?
A. N = 2*L
B. N = L + 1
C. N = L – 1
D. N = 2*L – 1
Answer» D. N = 2*L – 1
discuss
A. Let T be a binary tree. For every k ≥ 0, there are no more than 2k nodes in level k
B. Let T be a binary tree with λ levels. Then T has no more than 2λ – 1 nodes
C. Let T be a binary tree with N nodes. Then the number of levels is at least ceil(log (N + 1))
D. Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1))
Answer» D. Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1))
discuss
C. The left and right sub-trees should also be binary search trees
113. What is the speciality about the inorder traversal of a binary search tree?
A. O(n), O(n)
B. O(logn), O(logn)
C. O(logn), O(n)
D. O(n), O(logn)
115. What are the conditions for an optimal binary search tree and what is its advantage?
A. The tree should not be modified and you should know how often the keys are accessed, it improves the lookup cost
B. You should know the frequency of access of the keys, improves the lookup time
The tree can be modified and you should know the number of elements in the tree before hand, it improves the deletion
C.
time
D. The tree should be just modified and improves the lookup time
Answer» A. The tree should not be modified and you should know how often the keys are accessed, it improves the lookup cost
discuss
116. Which of the following is not the self balancing binary search tree?
A. AVL Tree
B. 2-3-4 Tree
D. Splay Tree
117. The binary tree sort implemented using a self – balancing binary search tree takes time is worst case.
A. O(n log n)
B. O(n)
C. O(n2)
D. O(log n)
118. An AVL tree is a self – balancing binary search tree, in which the heights of the two child sub trees of any
node differ by
A. At least one
B. At most one
C. Two
D. At most two
A. B-tree
A. 2-3 tree
C. AA tree
D. Treap
Answer» C. AA tree
discuss
A. Priority queue
B. Hash table
C. Heap sort
122. In which of the following self – balancing binary search tree the recently accessed element can be accessed
quickly?
A. AVL tree
B. AA tree
C. Splay tree
123. The minimum height of self balancing binary search tree with n nodes is
A. log2(n)
B. n
C. 2n + 1
D. 2n – 1
Answer» A. log2(n)
discuss
B. to save memory
D. to simplify storing
A. p
B. log(p)
C. log(p)/2
D. P⁄2
Answer» B. log(p)
discuss
127. Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without
performing any rotations?
B. find the median of the set of elements given, make it as root and construct the tree
Answer» B. find the median of the set of elements given, make it as root and construct the tree
discuss
128. What maximum difference in heights between the leafs of a AVL tree is possible?
C. 0 or 1
D. atmost 1
A. Height(w-left), x-height
B. Height(w-right), x-height
C. Height(w-left), x
D. Height(w-left)
B. AVL tree store balance factor in every node which costs space
Answer» B. AVL tree store balance factor in every node which costs space
discuss
131. Which of the following is the most widely used external memory data structure?
A. AVL tree
B. B-tree
C. Red-black tree
Answer» B. B-tree
discuss
132. B-tree of order n is a order-n multiway tree in which each non-root node contains
C. at least 2n keys
A. 255
B. 63
C. 127
D. 188
Answer» A. 255
discuss
134. Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are
written?
A. 14
B. 7
Answer» C. 11
134. Five node splitting operations occurred when an entry is inserted into a B-tree. Then how many nodes are
written?
C. 11
D. 5
Answer» C. 11
discuss
A. AVL
B. AA
C. 2-3
D. Red-Black
Answer» D. Red-Black
discuss
136. What is the best case height of a B-tree of order n and which has k keys?
A. logn (k+1) – 1
B. nk
C. logk (n+1) – 1
D. klogn
Answer» A. larger the order of B-tree, less frequently the split occurs
discuss (1)
138. In a max-heap, element with the greatest key is always in the which node?
A. Leaf node
C. root node
139. The worst case complexity of deleting any arbitrary node value element from heap is
A. O(logn)
B. O(n)
C. O(nlogn)
D. O(n2)
Answer» A. O(logn)
discuss
A. Priority queue
B. Stack
D. Normal Array
141. If we implement heap as min-heap, deleting root node (value 1)from the heap. What would be the value of
root node after second iteration if leaf node (value 100) is chosen to replace the root at start.
A. 2
B. 100
C. 17
D. none
Answer» A. 2
discuss
142. An array consists of n elements. We want to create a heap using the elements. The time complexity of
building a heap will be in order of
A. O(n*n*logn)
B. O(n*logn)
C. O(n*n)
Answer» B. O(n*logn)
discuss
144. For the given graph(G), which of the following statements is true?
A. G is a complete graph
D. none
145. What is the number of edges present in a complete graph having n vertices?
A. (n*(n+1))/2
B. (n*(n-1))/2
C. n
Answer» B. (n*(n-1))/2
discuss
A. True
B. False
C. none
D. none
Answer» A. True
discuss
A. 15
B. 3
Answer» B. 3
147. A connected planar graph having 6 vertices, 7 edges contains regions.
C. 1
D. 11
Answer» B. 3
discuss
148. If a simple graph G, contains n vertices and m edges, the number of edges in the Graph G'(Complement of
G) is
A. (n*n-n-2*m)/2
B. (n*n+n+2*m)/2
C. (n*n-n-2*m)/2
D. (n*n-n+2*m)/2
Answer» A. (n*n-n-2*m)/2
discuss
149. Which of the following properties does a simple graph not hold?
A. Must be connected
B. Must be unweighted
150. What is the maximum number of edges in a bipartite graph having 10 vertices?
A. 24
B. 21
C. 25
D. 16
Answer» C. 25
discuss
Chapter: Non Linear Data Structures - Graphs
152. For a given graph G having v vertices and e edges which is connected and has no cycles, which of the
following statements is true?
A. v=e
B. v = e+1
C. v + 1 = e
D. v = e-1
Answer» B. v = e+1
discuss
153. For which of the following combinations of the degrees of vertices would the connected graph be
eulerian?
A. 1,2,3
B. 2,3,4
C. 2,4,5
D. 1,3,5
Answer» A. 1,2,3
discuss
A. Multi Graph
B. Regular Graph
C. Simple Graph
D. Complete Graph
B. Incidence Matrix
D. No way to represent
156. The number of possible undirected graphs which may have self loops but no multiple edges and have n
vertices is
A. 2((n*(n-1))/2)
B. 2((n*(n+1))/2)
C. 2((n-1)*(n-1))/2)
D. 2((n*n)/2)
Answer» D. 2((n*n)/2)
discuss
157. Given a plane graph, G having 2 connected component, having 6 vertices, 7 edges and 4 regions. What will
be the number of connected components?
A. 1
B. 2
C. 3
D. 4
Answer» B. 2
discuss
158. Number of vertices with odd degrees in a graph having a eulerian walk is
A. 0
B. Can’t be predicted
C. 2
D. either 0 or 2
Answer» D. either 0 or 2
discuss
160. What is the number of vertices of degree 2 in a path graph having n vertices,here n>2.
A. n-2
B. n
C. 2
D. 0
Answer» A. n-2
discuss
161. What would the time complexity to check if an undirected graph with V vertices and E edges is Bipartite or
not given its adjacency matrix?
A. O(E*E)
B. O(V*V)
C. O(E)
D. O(V)
Answer» B. O(V*V)
discuss
162. With V(greater than 1) vertices, how many edges at most can a Directed Acyclic Graph possess?
A. (V*(V-1))/2
B. (V*(V+1))/2
C. (V+1)C2
D. (V-1)C2
Answer» A. (V*(V-1))/2
discuss
A. cubic
B. quadratic
C. linear
Answer» C. linear
163. The topological sorting of any DAG can be done in time.
D. logarithmic
Answer» C. linear
discuss
164. If there are more than 1 topological sorting of a DAG is possible, which of the following is true.
Answer» D. All the cyclic directed graphs have non topological sortings
discuss
166. What is the value of the sum of the minimum in-degree and maximum out-degree of an Directed Acyclic
Graph?
A. Depends on a Graph
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer» D. O(1)
discuss
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(1)
Answer» C. O(n)
discuss
169. What is the best case and worst case complexity of ordered linear search?
A. O(nlogn), O(logn)
B. O(logn), O(nlogn)
C. O(n), O(1)
D. O(1), O(n)
172. Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?
A. 5
Answer» C. 3
172. Given an input arr = {2,5,7,99,899}; key = 899; What is the level of recursion?
B. 2
C. 3
D. 4
Answer» C. 3
discuss
173. Given an array arr = {45,77,89,90,94,99,100} and key = 99; what are the mid values(corresponding array
elements) in the first and second levels of recursion?
A. 90 and 99
B. 90 and 94
C. 89 and 99
D. 89 and 94
Answer» A. 90 and 99
discuss
174. What is the worst case complexity of binary search using recursion?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» B. O(logn)
discuss
175. What is the average case time complexity of binary search using recursion?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» B. O(logn)
discuss
B. Union of intervals
C. Debugging
C. Greedy algorithm
D. Dynamic programming
178. Given an array arr = {5,6,77,88,99} and key = 88; How many iterations are done until the element is found?
A. 1
B. 3
C. 4
D. 2
Answer» D. 2
discuss
179. Given an array arr = {45,77,89,90,94,99,100} and key = 100; What are the mid values(corresponding array
elements) generated in the first and second iterations?
A. 90 and 99
B. 90 and 100
C. 89 and 94
D. 94 and 99
Answer» A. 90 and 99
discuss
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» B. O(logn)
discuss
181. What is an external sorting algorithm?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» D. O(n2)
discuss
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» D. O(n2)
discuss
185. Which of the following is not an advantage of optimised bubble sort over other sorting techniques in case
of sorted elements?
A. It is faster
186. The given array is arr = {1, 2, 4, 3}. Bubble sort is used to sort the array elements. How many iterations will
be done to sort the array?
A. 4
B. 2
C. 1
D. 0
Answer» A. 4
discuss
187. What is the best case efficiency of bubble sort in the improvised version?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» C. O(n)
discuss
188. The given array is arr = {1,2,4,3}. Bubble sort is used to sort the array elements. How many iterations will
be done to sort the array with improvised version?
A. 4
B. 2
C. 1
D. 0
Answer» B. 2
discuss
190. In the following scenarios, when will you use selection sort?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» D. O(n2)
discuss
192. What is the advantage of selection sort over other sorting techniques?
B. It is scalable
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» D. O(n2)
discuss
194. What is the disadvantage of selection sort?
B. It is not scalable
195. The given array is arr = {3,4,5,2,1}. The number of iterations in bubble sort and selection sort respectively
are,
A. 5 and 4
B. 4 and 5
C. 2 and 4
D. 2 and 5
Answer» A. 5 and 4
discuss
196. The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The number of
iterations in selection sort and bubble sort respectively are,
A. 5 and 4
B. 1 and 4
C. 0 and 4
D. 4 and 1
Answer» D. 4 and 1
discuss
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)
Answer» D. O(n2)
discuss
199. Statement 1: Shell sort is a stable sorting algorithm. Statement 2: Shell sort is an in-place sorting
algorithm.
D. none
200. Shell sort is applied on the elements 27 59 49 37 15 90 81 39 and the chosen decreasing sequence of
increments is (5,3,1). The result after the first iteration will be
A. 27 59 49 37 15 90 81 39
B. 27 59 37 49 15 90 81 39
C. 27 59 39 37 15 90 81 49
D. 15 59 49 37 27 90 81 39
Answer» C. 27 59 39 37 15 90 81 49
discuss
Chapter: Searching, Sorting and Hashing Techniques
A. insertion sort
B. selection sort
D. quick sort
A. 7-ordered
B. 5-ordered
203. If Hibbard increments (h1= 1, h2= 3, h3= 7, …, hk = 2k–1) are used in a Shell sortimplementation, then the
best case time complexity will be
A. O(nlogn)
B. O(n)
C. O(n2)
D. O(logn)
Answer» A. O(nlogn)
discuss
204. Records R1, R2, R3,.. RN with keys K1, K2, K3,.. KN are said to be h-ordered, if
Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes do not
A.
completely sort the elements
B. Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap like in Comb sort
C. Comb sort’s passes completely sort the elements before going on to the next-smallest gap like in Shell sort
Shell sort’s passes do not completely sort the elements before going on to the next-smallest gap while Comb sort’s passes
D.
completely sort the elements
Answer» A. Shell sort’s passes completely sort the elements before going on to the next-smallest gap while Comb sort’s passes
do not completely sort the elements
discuss
A. Heap sort
B. Smooth sort
C. Quick sort
207. What is the worst case time complexity of LSD radix sort?
A. O(nlogn)
B. O(wn)
C. O(n)
D. O(n + w)
Answer» B. O(wn)
discuss
A. (w/logR)
B. N(w/logR)
C. (w/log(RN))
D. (wN/log(N))
Answer» A. (w/logR)
discuss
A. Heap sort
B. Selection sort
211. Which of the following should be used to sort a huge database on a fixed-length key field?
A. Insertion sort
B. Merge sort
D. Quick sort
212. Which of the following is a combination of LSD and MSD radix sorts?
D. Flash sort
213. Which of the following is true for the LSD radix sort?
A. hashing by division
B. hashing by multiplication
C. universal hashing
D. open addressing
215. Which hash function satisfies the condition of simple uniform hashing?
A. h(k) = lowerbound(km)
B. h(k)= upperbound(mk)
C. h(k)= lowerbound(k)
D. h(k)= upperbound(k)
A. h(k) = k/m
B. h(k) = k mod m
C. h(k) = m/k
D. h(k) = m mod k
C. 2p – 1
D. 2p
A. open addressing
B. universal hashing
C. hashing by division
D. hashing by multiplication
219. Using division method, in a given hash table of size 157, the key of value 172 be placed at position
A. 19
B. 72
C. 15
D. 17
Answer» C. 15
discuss
220. How many steps are involved in creating a hash function using a multiplication method?
A. 1
B. 4
C. 3
D. 2
Answer» D. 2
discuss
B. using constant
D. simple multiplication
223. What is the table size when the value of p is 7 in multiplication method of creating hash functions?
A. 14
B. 128
C. 49
D. 127
Answer» B. 128
discuss
224. What is the average retrieval time when n keys hash to the same slot?
A. Theta(n)
B. Theta(n2)
C. Theta(nlog n)
D. Big-Oh(n2)
Answer» A. Theta(n)
discuss
More MCQs
225. Which if the following is/are the levels of implementation of data structure
A. abstract level
B. application level
C. implementation level
226. A binary search tree whose left subtree and right subtree differ in hight by at most 1 unit is called ……
A. avl tree
B. red-black tree
C. lemma tree
A. operations
B. storage structures
C. algorithms
D. none of above
A. data
B. operations
230. ……………. Is a pile in which items are added at one end and removed from the other.
A. stack
B. queue
C. list
Answer» B. queue
discuss
231. ………… is very useful in situation when data have to stored and then retrieved in reverse order.
A. stack
Answer» A. stack
231. ………… is very useful in situation when data have to stored and then retrieved in reverse order.
B. queue
C. list
D. link list
Answer» A. stack
discuss
232. Which data structure allows deleting data elements from and inserting at rear?
A. stacks
B. queues
C. dequeues
Answer» B. queues
discuss
233. Which of the following data structure can’t store the non-homogeneous data elements?
A. arrays
B. records
C. pointers
D. stacks
Answer» A. arrays
discuss
234. 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.
C. both of them
D. neither of them
A. stacks
B. list
C. strings
Answer» D. trees
235. Which of the following is non-liner data structure?
D. trees
Answer» D. trees
discuss
A. graphs
B. stacks
C. binary tree
D. queues
237. Which data structure is used in breadth first search of a graph to hold nodes?
A. stack
B. queue
C. tree
D. array
Answer» B. queue
discuss
238. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
C. priority queues
D. stack
A. strings
B. lists
C. stacks
D. graph
Answer» D. graph
discuss
240. Which of the following data structure is linear type?
A. graph
B. trees
C. binary tree
D. stack
Answer» D. stack
discuss
241. To represent hierarchical relationship between elements, Which data structure is suitable?
A. dequeue
B. priority
C. tree
D. graph
Answer» C. tree
discuss (1)
242. A directed graph is ………………. if there is a path from each vertex to every other vertex in the digraph.
A. weakly connected
B. strongly connected
C. tightly connected
D. linearly connected
243. In the …………….. traversal we process all of a vertex’s descendants before we move to an adjacent vertex.
A. depth first
B. breadth first
C. with first
D. depth limited
A. (n/2)+1
B. (n+1)/2
Answer» B. (n+1)/2
244. The number of comparisons done by sequential search is ………………
C. (n-1)/2
D. (n+2)/2
Answer» B. (n+1)/2
discuss
245. In ……………, search start at the beginning of the list and check every element in the list.
A. linear search
B. binary search
C. hash search
A. insertion sort
B. bubble sort
C. merge sort
D. heap sort
247. 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.
A. partite
B. bipartite
C. rooted
D. bisects
Answer» B. bipartite
discuss
248. In a queue, the initial values of front pointer f rare pointer r should be …….. and ……….. respectively.
A. 0 and 1
B. 0 and -1
C. -1 and 0
D. 1 and 0
Answer» B. 0 and -1
discuss
A. r=r+1
B. r=(r+1)% [queue_size – 1]
C. r=(r+1)% queue_size
D. r=(r-1)% queue_size
250. 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
251. What will be the value of top, if there is a size of stack STACK_SIZE is 5
A. 5
B. 6
C. 4
D. none
Answer» C. 4
discuss
A. insertion
B. deletion
C. retrieval
D. traversal
Answer» D. traversal
discuss
253. 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
discuss
254. A graph is a collection of nodes, called ………. And line segments called arcs or ……….. that connect pair of
nodes.
A. vertices, edges
B. edges, vertices
C. vertices, paths
A. network
B. weighted graph
C. both a and b
D. none a and b
256. In general, the binary search method needs no more than ……………. comparisons.
A. [log2n]-1
B. [logn]+1
C. [log2n]
D. [log2n]+1
Answer» D. [log2n]+1
discuss
A. ordinary queue
C. circular queue
D. priority queue
259. Any node is the path from the root to the node is called
A. successor node
B. ancestor node
C. internal node
A. function calls
261. 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
262. …………………. Is a directed tree in which outdegree of each node is less than or equal to two.
A. unary tree
B. binary tree
C. trinary tree
D. both b and c
A. strings
B. lists
C. stacks
D. tree
Answer» D. tree
discuss
A. array
B. tree
C. graphs
D. hierarchy
Answer» A. array
discuss
265. 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
A. multidimensional array
B. linear array
B. one-dimensional array
C. vertical array
D. horizontal array
B. for the size of the structure and the data in the structure are constantly changing
A. linear arrays
B. linked lists
C. graphs
D. trees
270. Each node in a linked list has two pairs of ………….. and ……………….
271. A …………………… does not keep track of address of every element in the list.
A. stack
B. string
C. linear array
D. queue
A. before deletion
D. after deletion
B. for the size of the structure and the data in the structure are constantly changing
B. for the size of the structure and the data in the structure are constantly changing
275. A linear list in which each node has pointers to point to the predecessor and successors nodes is called as
..
276. 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
Answer» D. dequeue
discuss
277. In a priority queue, insertion and deletion takes place at ………………
D. any position
A. o(n)
B. o(n2)
C. o(n log n)
D. o(log n)
A. finding factorial
B. tower of hanoi
A. queue
B. stack
C. tree
D. graph
Answer» B. stack
discuss
281. A list which displays the relationship of adjacency between elements is said to be
A. linear
B. non linear
Answer» A. linear
281. A list which displays the relationship of adjacency between elements is said to be
C. linked list
D. trees
Answer» A. linear
discuss
282. ……………….. level is where the model becomes compatible executable code
A. abstract level
B. application level
C. implementation level
283. Which of the following data structure is not linear data structure?
A. arrays
B. linked lists
284. 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.
A. push, pop
B. pop, push
C. insert, delete
D. delete, insert
285. Each array declaration need not give, implicitly or explicitly, the information about
286. The elements of an array are stored successively in memory cells because
by this way computer can keep track only the address of the first element and the addresses of other elements can be
A.
calculated
B. the architecture of computer memory does not allow arrays to store other than serially
C. both of above
D. none of above
Answer» A. by this way computer can keep track only the address of the first element and the addresses of other elements can
be calculated
discuss
B. for the size of the structure and the data in the structure are constantly changing
Answer» B. for the size of the structure and the data in the structure are constantly changing
discuss
288. Finding the location of the element with a given value is:
A. traversal
B. search
C. sort
D. none of above
Answer» B. search
discuss
A. sorting
B. merging
C. inserting
D. traversal
Answer» D. traversal
discuss
290. Arrays are best data structures
B. for the size of the structure and the data in the structure are constantly changing
A. i-only
B. ii-only
C. both i and ii
292. What will be the value of top, if there is a size of stack STACK_SIZE is 5
A. 5
B. 6
C. 4
Answer» C. 4
discuss
A. insertion
B. deletion
C. retrieval
D. traversal
Answer» D. traversal
discuss
294. A data structure where elements can be added or removed at either end but not in the middle is called …
A. linked lists
Answer» D. dequeue
294. A data structure where elements can be added or removed at either end but not in the middle is called …
B. stacks
C. queue
D. dequeue
Answer» D. dequeue
discuss
A. fifo lists
B. lifo list
C. piles
D. push-down lists
A. array
B. lists
C. stacks
Answer» C. stacks
discuss
297. Which data structure allows deleting data elements from front and inserting at rear?
A. stacks
B. queue
C. dequeue
Answer» B. queue
discuss
A. node.next inaccessible
B. node.next.next inaccessible
A. stack
B. queue
Answer» B. two pointers are maintained to store next and previous nodes.
discuss
More MCQs
301. A linear list in which each node has pointers to point to the predecessor and successors nodes is called as
A. underflow
B. overflow
C. housefull
D. saturated
Answer» A. underflow
discuss
C. in both directions
304. 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) {
A.
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) {
B.
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
C.
&& 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
D.
&& temp == null) { temp = head.getnext(); length++; } return length; }
Answer» A. 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; }
discuss
305. public int function()
{
if(head == null)
return Integer.MIN_VALUE;
int var;
Node temp = head;
while(temp.getNext() != head)
temp = temp.getNext();
if(temp == head)
{
var = head.getItem();
head = null;
return var;
}
temp.setNext(head.getNext());
var = head.getItem();
head = head.getNext();
return var;
} What is the functionality of the following code? Choose the most appropriate answer.
B. returns the data and deletes the node at the end of the list
D. returns the data and deletes the node from the beginning of the list
Answer» D. returns the data and deletes the node from the beginning of the list
discuss
306. What is the functionality of the following code? Choose the most appropriate answer. public int function()
{
if(head == null)
return Integer.MIN_VALUE;
int var;
Node temp = head;
Node cur;
while(temp.getNext() != head)
{
cur = temp;
temp = temp.getNext();
}
if(temp == head)
{
var = head.getItem();
head = null;
return var;
}
var = temp.getItem();
cur.setNext(head);
return var;
}
B. returns the data and deletes the node at the end of the list
D. returns the data and deletes the node from the beginning of the list
Answer» B. returns the data and deletes the node at the end of the list
discuss
public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node);
A.
head.setnext(node); size++; }
public class insertfront(int data) { node node = new node(data, head, head); node.getnext().setprev(node);
B.
head.setnext(node); size++; }
public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(head);
C.
head.setnext(node); size++; }
public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node);
D.
head.setnext(node.getnext()); size++; }
Answer» A. public class insertfront(int data) { node node = new node(data, head, head.getnext()); node.getnext().setprev(node);
head.setnext(node); size++; }
discuss
308. What is a dequeue?
A. a queue with insert/delete defined for both front and rear ends of the queue
Answer» A. a queue with insert/delete defined for both front and rear ends of the queue
discuss
309. 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
310. Suppose implementation supports an instruction REVERSE, which reverses the order of elements on the
stack, in addition to the PUSH and POP instructions. Which one of the following statements is TRUE with
respect to this modified stack?
B. a queue can be implemented where enqueue takes a single instruction and dequeue takes a sequence of two instructions.
C. a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single instruction.
D. a queue can be implemented where both enqueue and dequeue take a single instruction each.
Answer» C. a queue can be implemented where enqueue takes a sequence of three instructions and dequeue takes a single
instruction.
discuss
311. Suppose you are given an implementation of a queue of integers. The operations that can be performed
on the queue are:
i. isEmpty (Q) — returns true if the queue is empty, false otherwise.
ii. delete (Q) — deletes the element at the front of the queue and returns its value.
iii. insert (Q, i) — inserts the integer i at the rear of the queue.
Consider the following function:
void f (queue Q) {
int i ;
if (!isEmpty(Q)) {
i = delete(Q);
f(Q);
insert(Q, i);
}
}What operation is performed by the above function f ?
C. deletes the element at the front of the queue q and inserts it at the rear keeping the other elements in the same order
312. Consider the following statements:i. First-in-first out types of computations are efficiently supported by
STACKS.
ii. Implementing LISTS on linked lists is more efficient than implementing LISTS on
an array for almost all the basic LIST operations.
iii. Implementing QUEUES on a circular array is more efficient than implementing QUEUES
on a linear array with two indices.
iv. Last-in-first-out type of computations are efficiently supported by QUEUES.Which of the following is
correct?
if the queue is implemented with a linked list, keeping track of a front pointer, only rear pointer s will change during an
A.
insertion into an non-empty queue.
Answer» C. queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault
algorithm.
313. Which of the following option is not correct?
B. queue data structure can be used to implement least recently used (lru) page fault algorithm and quick short algorithm.
C. queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault algorithm.
Answer» C. queue data structure can be used to implement quick short algorithm but not least recently used (lru) page fault
algorithm.
discuss
314. Consider a standard Circular Queue 'q' implementation (which has the same condition for Queue Full and
Queue Empty) whose size is 11 and the elements of the queue are q[0], q[1], q[2].....,q[10]. The front and
rear pointers are initialized to point at q[2] . In which position will the ninth element be added?
A. q[0]
B. q[1]
C. q[9]
D. q[10]
Answer» A. q[0]
discuss
315. Overflow condition in linked list may occur when attempting to .............
D. none of these
317. Linked list is generally considered as an example of _________ type of memory allocation.
A. static
Answer» B. dynamic
317. Linked list is generally considered as an example of _________ type of memory allocation.
B. dynamic
C. compile time
D. none of these
Answer» B. dynamic
discuss
318. Each Node contain minimum two fields one field called data field to store data. Another field is of type
_________.
A. pointer to class
B. pointer to an integer
C. pointer to character
D. pointer to node
319. If in a linked list address of first node is 1020 then what will be the address of node at 5th position ?
A. 1036
B. 1028
C. 1038
D. none of these
320. In Circular Linked List insertion of a node involves the modification of ____ links.
A. 3
B. 4
C. 1
D. 2
Answer» D. 2
discuss
A. hollow
B. empty
C. finite
Answer» B. empty
321. If a list contains no elements it is said to be
D. infinite
Answer» B. empty
discuss
A. 1 type
B. 2 type
C. 3 type
D. 4 type
Answer» B. 2 type
discuss
A. tail
B. head
C. terminator
D. initiator
Answer» B. head
discuss
A. nodes
B. arrays
C. entities
D. instances
Answer» A. nodes
discuss
326. How do you calculate the pointer difference in a memory efficient double linked list?
327. 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
Answer» D. dequeue
discuss
A. fifo lists
B. lifo list
C. piles
D. push-down lists
329. A data structure where elements can be added or removed at either end but not in the middle is called …
A. arrays
B. stacks
C. queues
D. deque
Answer» D. deque
discuss
A. ab + cd∗e − fg /∗∗
B. / ab + cd ∗ e − f ∗∗g /
C. ab + cd ∗ e − ∗f ∗ g /
D. ab + cde ∗ − ∗ f ∗ g /
331. What is the postfix form of the following prefix expression -A/B*C$DE ?
A. abcde$*/-
B. a-bcde$*/-
C. abc$ed*/-
D. a-bcde$*/
Answer» A. abcde$*/-
discuss
A. queue
B. stacks
C. array
D. linked-list
Answer» B. stacks
discuss
A. ab+cd–*
B. abc+*–
C. ab+*cd–
D. ab+*cd–
Answer» A. ab+cd–*
discuss
334. A queue is a,
C. ordered array
D. linear tree
A. delete
B. insert
A. bus stop
B. movie hall
C. shopping mall
A. a pile of books
B. bus stop
C. a basket of fruits
D. a carat of eggs
338. When a stack is organized as an array, a variable named Top is used to point to the top element of the
stack. Initially, the value of Top is set to_______to indicate an empty stack.
A. -1
B. 0
C. 1
D. x
Answer» A. -1
discuss
339. What happens when the stack is full and there is no space for a new element, and an attempt is made to
push a new element?
A. overflow
Answer» A. overflow
339. What happens when the stack is full and there is no space for a new element, and an attempt is made to
push a new element?
B. underflow
C. top
Answer» A. overflow
discuss
340. The total number of elements in a stack at a given point of time can be calculated from the value of______.
A. overflow
B. top
C. queues
D. underflow
Answer» B. top
discuss
341. When the push operation is performed on stack the value of TOS will be ______
A. decrement
B. increment
C. one
D. none of these
Answer» B. increment
discuss
A. previous node
B. next node
C. current node
D. both a & b
343. Data Structure that are created by user as per their requirement are known as
C. both a & b
D. none of these
344. To insert element at start, the previous pointer of newly added node would point to ______
A. null
B. next node
C. new node
D. head node
Answer» A. null
discuss
A. the data
B. the link
C. both a & b
D. none of these
A. strings
B. stack
C. queue
D. all of these
A. lifo
B. fifo
C. both a & b
D. none of these
Answer» A. lifo
discuss
348. In stack deletion operation is referred as _____
A. push
B. pop
C. peek
D. none of these
Answer» B. pop
discuss
A. lifo
B. fifo
C. both a & b
D. none of these
Answer» B. fifo
discuss
A. 4
B. 3
C. 2
D. 1
Answer» C. 2
discuss
More MCQs
351. In ___ Data Structure data can be processed one by one sequentially
A. array
B. linked list
C. tree
D. none of these
A. front
B. rear
C. both a & b
D. none of these
Answer» B. rear
discuss
A. push
B. pop
C. display
D. enqueue
Answer» D. enqueue
discuss
A. push
B. pop
C. display
D. enqueue
Answer» D. enqueue
discuss
355. In stack, to display the lastly inserted element without removing it, which function is used?
A. push
Answer» D. peek
355. In stack, to display the lastly inserted element without removing it, which function is used?
B. pop
C. display
D. peek
Answer» D. peek
discuss
356. if there are no nodes in linked list then start pointer will point at which value?
A. null
B. garbage
C. 1
D. 2
Answer» A. null
discuss
A. o(n)
B. o(log(n))
C. o(1)
D. n/a
Answer» A. o(n)
discuss
A. o(log(n))
B. o(1)
C. n/a
D. o(n)
Answer» D. o(n)
discuss
A. data value.
B. attribute value.
C. data item.
D. elementary.
360. Data items that are divided into subitems are called ___________.
A. single items.
B. group items.
C. elementary items.
D. entity items.
362. In _______________all the records contain the same data items with the same amount of space.
A. variable-length records.
B. fixed-length records.
C. subscripted variable.
D. superscripted variable.
363. The logical or mathematical model of a particular organization of data is called a _______________.
A. data structure.
B. algorithms.
C. structure.
D. logic structure.
B. the size of the structure and the data in the structure are constantly changing.
A. Through Queues.
B. Through Stacks.
C. Through Trees.
D. Through Graphs.
366. __________is combining the records in two different sorted files in to a single sorted file.
A. Sorting.
B. Searching.
C. Listing.
D. Merging.
Answer» D. Merging.
discuss
367. In linear search algorithm the Worst case occurs when ____________.
D. The item is the last element in the array or is not there at all.
Answer» D. The item is the last element in the array or is not there at all.
discuss
A. O(n).
B. O(log n ).
C. O(n2).
Answer» B. O(log n ).
368. The complexity of Binary search algorithm is ____________.
Answer» B. O(log n ).
discuss
A. O(n).
B. O(log n).
C. O(n2).
Answer» C. O(n2).
discuss
A. unsorted list.
B. sorted list.
C. reverse of input.
D. none of these.
371. Sub algorithms fall into two basic categories: function sub algorithms and ____________ sub algorithms.
A. procedure.
B. argument.
C. processor.
D. methods.
Answer» A. procedure.
discuss
A. Underflow.
B. Overflow.
C. Houseful.
D. Saturated.
Answer» B. Overflow.
discuss
A. Tree.
B. Graph.
C. Array.
D. Linked list.
Answer» C. Array.
discuss
A. Fibonacci Series
B. Tower of Hanoi
A. floor address.
B. foundation address.
C. first address.
D. base address.
377. Which data structure allows deleting data elements from front and inserting at rear?
A. Stacks.
B. Queues.
Answer» B. Queues.
377. Which data structure allows deleting data elements from front and inserting at rear?
C. Dequeues.
Answer» B. Queues.
discuss
D. pointer array.
380. Linked lists are suitable for which of the following problems?
A. Insertion sort
B. Binary search
C. Radix sort
D. dequeue.
381. 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 dequeue.
C. Priority queues.
D. Data structure.
A. Strings.
B. Lists.
C. Stacks.
D. Hierarchical.
Answer» D. Hierarchical.
discuss
383. To represent hierarchical relationship between elements, which data structure is suitable?
A. Dequeue.
B. Priority.
C. Tree.
D. Binary tree.
Answer» C. Tree.
discuss
A. Compile-time
B. Run-time
C. Not an error
Answer» B. Run-time
discuss
385. The depth of a complete binary tree is given by__________.
A. Dn = n log2n.
B. Dn = n log2n+1.
C. Dn = log2n.
D. Dn = log2n+1.
Answer» D. Dn = log2n+1.
discuss
386. When converting binary tree into extended binary tree, all the original nodes in binary tree are___________.
387. Which of the following conditions checks available free space in avail list?
A. Avail=Top
B. Null=Avail
C. Avail=Null
D. Avail=Max stack
Answer» C. Avail=Null
discuss
A. Bubble sort.
B. Insertion sort.
C. Quick sort.
D. Algorithm.
A. FIFO
B. LIFO
Answer» B. LIFO
389. STACK is also called as ______________.
C. FOLI
D. FOFI
Answer» B. LIFO
discuss
A. files
B. fields
C. attributes.
D. records.
Answer» D. records.
discuss
A. binary tree.
B. stacks.
C. graphs.
D. both a and c.
Answer» C. graphs.
discuss
392. A variable whose size is determined at compile time and cannot be changed at run time is_________.
A. static variable.
B. dynamic variable.
C. not a variable.
D. data variable.
A. Create
B. Push
C. Evaluation
D. Pop
Answer» B. Push
discuss
394. Length of linear array can be found by using the formula_________
A. UB-LB+1
B. LB+UB
C. LB-UB
D. LB-UB+1
Answer» A. UB-LB+1
discuss
395. The average number of key comparisons done in a successful sequential search in a list of length n
is___________.
A. log n
B. n-1/2.
C. n/2.
D. n+1/2.
Answer» D. n+1/2.
discuss
A. Binary Search
B. Linear Search
C. Tree Search
D. Hashing
Answer» D. Hashing
discuss
A. first element
B. middle element
C. last element
D. pivot element
398. A _____________ list is a list where the last node contains null pointer.
A. circular header.
B. grounded header.
C. rounded header.
D. linked header.
A. Pointers.
B. Memory location.
C. Records.
D. Variables.
Answer» A. Pointers.
discuss
A. decision tree.
B. binary tree.
C. sequential tree.
D. b+ tree.
401. A linked list whose last node points back to the list node instead of containing the null pointer________.
A. circular list.
B. linked list.
402. __________________ is a header list where the last node contains the null pointer.
C. Linked list
D. Linear Array
403. Which of the following case does not exist in complexity theory
A. Best case
B. Worst case
C. Average case
D. Null case
404. The _________ for a linked list is a pointer variable that locates the beginning of the list.
A. anchor.
B. base.
C. footer.
D. header.
Answer» D. header.
discuss
405. The time factor when determining the efficiency of algorithm is measured by____________.
A. counting microseconds.
406. The space factor when determining the efficiency of algorithm is measured by___________.
Answer» D. item is the last element in the array or is not there at all.
discuss
A. O(log n).
B. O(n).
C. O(n2).
Answer» B. O(n).
discuss
409. The time required in best case for search operation in binary tree is ____________.
A. O(n).
B. O(2n).
C. O(log n).
D. O( log 2n).
Answer» D. Left sub tree -> Right sub tree -> Root.
discuss
411. A _________is a linked list which always contains a special node called the header node, at the beginning of
the list.
B. Circular List.
D. None.
412. _______________is a header list where the last node points back to the header node.
413. The advantage of a two-way list and a circular header list is combined into a ________.
D. None.
A. null pointer.
B. index pointer.
C. pointer link.
D. address pointer.
415. The OS of a computer may periodically collect all the deleted space onto the free storage list. This
technique is called______________.
A. buffering.
B. garbage collection.
C. deal location.
D. buffer collection.
416. Important part of any compiler is the construction and maintenances of a dictionary, this types of
dictionary are called______________.
A. symbol table.
B. index table.
C. grammar table.
D. pointer table.
417. The data structure required to check whether an expression contains balanced parenthesis is?
A. queue
B. stack
C. linked list
D. file
Answer» B. stack
discuss
419. The number of possible ordered trees with three nodes A,B,C is?
A. 16
B. 12.
C. 10
D. 6
Answer» B. 12.
discuss
420. The earliest use of__________ sorting was in conjunction with network analysis.
A. topological.
B. bubble.
C. radix.
D. heap.
Answer» A. topological.
discuss
A. Traversal.
B. Insertion.
C. Deletion.
D. Retrieval.
Answer» A. Traversal.
discuss
A. loops.
B. domains.
C. functions.
Answer» D. nodes.
422. A tree is a finite set of_________.
D. nodes.
Answer» D. nodes.
discuss
A. Tree.
B. Graph.
C. One-way List.
D. None.
425. Matrices with a relatively high proportion of zero entries are called _______ matrices.
A. sparse.
B. Null.
C. Zero.
D. worse.
Answer» A. sparse.
discuss
A. ab + cd - *
B. abcd +-*
C. ab+cd*-
D. ab+-cd*
Answer» A. ab + cd - *
discuss
427. Data structure which is capable of expressing more complex relationship than that of physical adjacency is
called______________.
B. linked list.
D. data structure.
428. A tree is a data structure which represents hierarchical relationship between individual _________.
A. data items.
B. fields.
C. nodes.
D. linked list.
429. In a directed tree any node which has out degree 0 is called a terminal node or__________.
A. a tree.
B. a list.
C. a node.
D. a leaf.
Answer» D. a leaf.
discuss
430. In a directed tree if the ordering of the nodes at each level is prescribed then such a tree is called_______
tree.
A. directed.
B. structure.
C. ordered.
D. degree of.
Answer» C. ordered.
discuss
431. ______________ a tree means processing it in such a way that each node is visited only once.
A. Traversing.
Answer» A. Traversing.
431. ______________ a tree means processing it in such a way that each node is visited only once.
B. Implement.
C. Partition.
D. Node.
Answer» A. Traversing.
discuss
432. The length of the path is the number of_____________ on the path.
A. nodes.
B. fields.
C. data.
D. edges.
Answer» D. edges.
discuss
A. binary tree.
B. tree.
C. sibling.
D. list.
Answer» C. sibling.
discuss
A. Overflow
B. Underflow
C. Zero
Answer» B. Underflow
discuss
435. A code which deals about short form of a program is called __________ code.
A. program.
B. data.
C. pseudo.
Answer» C. pseudo.
435. A code which deals about short form of a program is called __________ code.
D. derived.
Answer» C. pseudo.
discuss
A. Expression Evaluation
437. The queue which wraps around upon reaching the end of the array is called as____________.
A. circular queue.
B. linked queue.
D. representation of queue.
438. A _______________ is a reference to a memory location, which is used to store data that is described in a data
type.
A. element.
B. variable.
C. pointer.
D. memory.
Answer» B. variable.
discuss
439. If the elements A, B, C and D are placed in a stack and are deleted one at a time, what is the order of
removal?
A. ABCD
B. DCBA
C. DCAB
D. ABDC
Answer» B. DCBA
discuss
440. ____________ has certain attributes or properties which may be assigned values.
A. field system.
B. record.
C. entity.
D. files.
Answer» C. entity.
discuss
441. The number of interchanges required to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is
____________.
A. 6
B. 5
C. 7
D. 8
Answer» B. 5
discuss
A. n.
B. n-1.
C. n+1.
D. 2n+1.
Answer» B. n-1.
discuss
A. queue full
B. queue empty
C. dequeue
D. priority queue
A. Efficient.
B. Linked list.
C. Data structure.
D. Algorithm.
Answer» D. Algorithm.
discuss
A. Overflow.
B. Underflow.
C. Null.
D. Empty.
Answer» B. Underflow.
discuss
A. registers.
B. free pool.
C. recycle bin.
A. ABDE - * /
B. - * / ABDE
C. A B - D E * /
D. * - A B / D E
Answer» D. * - A B / D E
discuss
448. Each data item in a record may be a group item composed of sub-items; those items which are
indecomposable are called ________
A. elementary items.
B. atoms.
Answer» D. structure.
448. Each data item in a record may be a group item composed of sub-items; those items which are
indecomposable are called ________
C. scalars.
D. structure.
Answer» D. structure.
discuss
A. recursion.
B. traversal.
C. heaps.
D. queues.
Answer» A. recursion.
discuss
450. What is the worst-case time for heap sort to sort an array of n elements?
A. O(log n).
B. O(n).
D. O(n²).
A. ceiling.
B. time.
C. space.
D. floor.
Answer» A. ceiling.
discuss
452. A binary tree of depth "d" is an almost complete binary tree if __________.
C. both a and b.
D. None.
453. Program module contains its own list of variables called ____________.
A. global.
B. scope.
C. local.
D. external.
Answer» C. local.
discuss
A. 15.
B. 20.
C. 63.
D. 31.
Answer» D. 31.
discuss
A. null string.
B. zero string.
C. one string.
D. empty string.
456. The unit equal to the number of bits needed to represent a character is called a ________.
A. byte.
B. bit.
C. mega bytes.
D. kilo bytes.
Answer» A. byte.
discuss
457. The number of swapping needed to sort numbers 8,22,7,9,31,19,5,13 in ascending order using bubble sort
is ?
A. 11
B. 12
C. 13
D. 14
Answer» D. 14
discuss
458. In variable length storage two dollar signs are used to signal the __________.
D. index.
459. The initial configuration of the queue is a,b,c,d (a is the front end). To get the configuration d,c,b,a one
needs a minimum of ?
A. 2
B. 3
C. 4
D. 5
Answer» A. 2
discuss
A. string delimiters.
B. period.
C. stopper.
D. string.
462. A string `s` consists of x, y and if x is an empty string then y is called as___________.
A. initial substring.
B. substring of s.
D. index.
463. The length of the string can be listed as an additional item in _____________.
A. base pointer.
B. pointer array.
C. node.
D. record.
A. Hoare.
B. Sedgewick.
C. Mellroy.
D. Coreman.
Answer» A. Hoare.
discuss
465. For the heap sort, access to nodes involves simple _______________ operations.
A. binary.
B. arithmetic
C. algebraic
D. logarithmic
Answer» B. arithmetic
discuss
A. 2i-1.
B. 3i-1.
C. i+1.
D. 2i+1.
Answer» A. 2i-1.
discuss
467. The number of edges in a regular graph of degree d and n vertices is _______.
A. maximum of n,d.
B. n+d.
C. nd.
D. nd/2.C
Answer» C. nd.
discuss
468. Which of the following is useful in traversing a given graph by Breath first search?
A. Stack.
Answer» D. Queue.
468. Which of the following is useful in traversing a given graph by Breath first search?
B. Set.
C. List.
D. Queue.
Answer» D. Queue.
discuss
B. memory allocation.
C. static allocation.
D. random allocation.
A. successively.
B. randomly.
C. alternately.
D. on any order.
Answer» A. successively.
discuss
A. sorting.
B. traversing.
C. searching.
Answer» B. traversing.
472. Accessing and processing each array elements is called __________.
D. merging.
Answer» B. traversing.
discuss
A. m.
B. n.
C. m2.
D. m*n.
Answer» D. m*n.
discuss
474. The sequence (1,1) (2,1) (3,1) (1,2) (2,2) (3,2) . . . .represents _________.
C. random order.
D. successive order.
A. pre-order
B. post-order
C. prefix
D. in-order
Answer» C. prefix
discuss
476. Selection sort and quick sort both fall into the same category of sorting algorithms._________ is that
category.
B. Divide-and-conquer sorts.
C. Interchange sorts.
A. merge.
B. obstacle.
C. overlapping.
D. collision.
Answer» C. overlapping.
discuss
478. Uniform distribution of the hash address throughout the given set L is __________.
D. manage address.
A. multiple edges.
B. loops.
C. finite.
D. digraph.
Answer» B. loops.
discuss
A. Arranging.
B. Bonding.
C. Combing.
D. Chaining.
Answer» D. Chaining.
discuss
A. Algorithm.
B. Program.
Answer» A. Algorithm.
481. An _________ is a well defined list of steps for solving a problem.
C. Procedure.
D. Process.
Answer» A. Algorithm.
discuss
482. The data items in a record form a ________ structure which can be described by means of level numbers.
A. hierarchical.
B. procedural.
C. indexed.
D. leveled.
Answer» A. hierarchical.
discuss
483. A path P of length n from a node u to a node v is defined as a sequence of _________ nodes.
A. n.
B. n+1.
C. n+2.
D. n-1.
Answer» B. n+1.
discuss
A. padent
B. isolated vertex
C. null vertex
D. colored vertex
Answer» A. padent
discuss
A. a tree graph.
B. free tree.
C. a tree.
A. isolate.
B. complete.
C. finite.
D. Strongly connected.
Answer» B. complete.
discuss
A. endpoints.
B. adjacent nodes.
C. neighbours.
488. Which of the following is true while inserting a new node in the list?
C. There is no node.
D. Underflow.
A. Linear arrays.
B. Linked lists.
C. Arrays.
D. First address.
A. Algorithm.
B. Tree.
Answer» D. Graph.
490. The efficiency of a BFS algorithm is dependent on _______.
C. Problem.
D. Graph.
Answer» D. Graph.
discuss
491. The average number of key comparisons done in a successful sequential search in a list of length n is
____________.
A. log n.
B. n-1/2.
C. n/2.
D. n+1/2.
Answer» D. n+1/2.
discuss
492. Divide and conquer is an important algorithm design paradigm based on _______.
A. multi-branched recursion.
B. single-branched recursion.
C. two-way recursion.
D. None.
493. The correctness of a divide and conquer algorithm is usually proved by _________.
A. mathematical theorem.
B. de-Morgan `s law.
C. mathematical induction.
D. none.
A. Heap sort.
B. Quick sort.
C. Merge sort.
D. Radix sort.
495. ____________ is finding a path/tour through the graph such that every vertex is visited exactly once.
B. Eulerian tour.
C. Hamiltonian tour.
D. None.
A. Array.
B. Linked list.
C. Queue.
D. Stack.
Answer» D. Stack.
discuss
497. The binary tree that has n leaf nodes. The number of nodes of degree 2 in this tree is
A. log2N
B. n-1
C. n
Answer» B. n-1
discuss
A. Link.
B. Node.
C. Data Structure.
D. Avail.
Answer» B. Node.
discuss
A. End list.
B. Zero list.
C. Null list.
D. Sentinel list.
501. The special list which consists of unused memory space is called __________.
A. Free space.
B. Empty space.
C. Available space.
502. To insert a new node in linked list free node will be available in ___________.
A. Available list.
B. Avail list.
503. A ______________ list is a header list where the node points back to the header node.
A. Circular header.
B. Grounded header.
504. How many pointers are necessarily changed for the insertion in a Linked List?
A. 1.
B. 2.
C. 3.
D. 5.
Answer» B. 2.
discuss
A. Sub algorithm. .
Answer» B. Recursion.
505. An algorithm that calls itself directly or indirectly is known as ____________.
B. Recursion.
C. Polish notation.
D. Traversal algorithm.
Answer» B. Recursion.
discuss
506. Minimum number of fields in each node of a doubly linked list is____
A. 2
B. 3
C. 4
Answer» B. 3
discuss
507. A graph in which all vertices have equal degree is known as ____
A. Complete graph
B. Regular graph
C. Multi graph
D. Simple graph
A. Root vertex
B. Isolated vertex
C. Sink
D. Articulation point
Answer» C. Sink
discuss
A. Directed graph
B. Contains no cycles
C. Planar
D. Completely connected
A. In a structure
B. In an array
A. List
B. Queue
C. Stack
Answer» C. Stack
discuss
512. To perform level-order traversal on a binary tree, which of the following data structure will be required?
A. Hash table
B. Queue
D. Stack
Answer» B. Queue
discuss
513. Which of the following data structure is required to convert arithmetic expression in infix to its equivalent
postfix notation?
A. Queue
B. Linked list
D. None of above
A. Threaded tree
515. Which of following data structure is more appropriate for implementing quick sort iteratively?
A. Deque
B. Queue
C. Stack
D. Priority queue
Answer» C. Stack
discuss
A. n(n+1)/2
B. n(n-1)/2
C. n2/2
D. n
Answer» B. n(n-1)/2
discuss
517. 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
518. 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
A. Discovering
B. Finding
C. Searching
D. Mining
Answer» C. Searching
discuss
A. merge sort
B. tree sort
C. shell sort
521. ………. sorting is good to use when alphabetizing a large list of names.
A. Merge
B. Heap
C. Radix
D. Bubble
Answer» C. Radix
discuss
A. O(n logn)
B. O(2n)
C. O(n2)
D. O(n)
C. Both a and b
D. None of these
A. Front
B. Back
C. Middle
D. Both A and B
Answer» B. Back
discuss
A. Array
B. Lists
C. Stacks
D. Trees
Answer» C. Stacks
discuss
A. finding factorial
B. tower of Hanoi
C. infix to postfix
A. sorting
B. merging
Answer» D. traversal
527. The operation of processing each element in the list is known as ……
C. inserting
D. traversal
Answer» D. traversal
discuss
A. Underflow
B. Overflow
C. Houseful
D. Saturated
Answer» A. Underflow
discuss
A. FIRST
B. AVAIL
C. TOP
D. REAR
Answer» B. AVAIL
discuss
531. Which of the following data structure can’t store the non-homogeneous data elements?
A. Arrays
B. Records
C. Pointers
D. Stacks
Answer» A. Arrays
discuss
532. Which of the following is non-liner data structure?
A. Stacks
B. List
C. Strings
D. Trees
Answer» D. Trees
discuss
533. To represent hierarchical relationship between elements, which data structure is suitable?
A. Dequeue
B. Priority
C. Tree
D. Graph
Answer» C. Tree
discuss
534. Identify the data structure which allows deletions at both ends of the list but insertion at only one end.
C. Priority queues
D. Stack
https://www.instagram.com/codewitharrays/
https://codewitharrays.in/project