Datastructure and Algorithms MCQ
Datastructure and Algorithms MCQ
COM
101. The maximum number of comparisons needed to sort 7 items using radix sort is (assume each item
is a 4 digit decimal number)
1. 280
2. 40
3. 47
4. 38
102. If each node in a tree has a value greater than every value in its left sub tree and has value less than
every value in its right sub tree, the binary tree is known as
1. Complete binary tree
2. Full binary tree
3. Binary search tree
4. Threaded binary tree
103. A binary tree in which if all its levels except possibly the last, have the maximum number of nodes
and all the nodes at the last level appear as far as possible, is known as
1. full binary tree
2. 2-tree
3. threaded tree
4. Complete binary tree
104. You are asked 15 randomly generated numbers. You should prefer
1. bubble sort
2. quick sort
3. merge sort
4. heap sort
105. Which data structure is needed to convert infix notation to post fix notation
1. B-tee
2. Queue
3. Tree
4. Stack
106. The time required to search an element in a binary search tree having n elements is
1. O(1)
2. O(log2 n)
3. O(n)
4. O(n log2 n)
107. A binary tree T has n leaf nodes. The number of nodes of degree 2 in T is
1. log2 n
2. n-1
3. n
4. 2n
108. A tree, for which at every node the height of its left sub tree and right sub tree differ at most by one
is a/an
1. Binary search tree
2. AVL tree
3. Complete binary tree
4. Threaded binary tree
109. Which of the following sorting algorithms does not have a worst case running time complexity of
O(n2)?
http://targatenet.com/2017/03/23/data-structure-and-algorithms-mcq-gate-net-set-10/ 1/6
9/2/2017 DATASTRUCTURE AND ALGORITHMS MCQ GATE NET SET 10 | tarGATENET.COM
1. Insertion sort
2. Merge sort
3. Quick sort
4. Bubble sort
111. There are 4 different algorithms A1,A2,A3,A4 to solve a given problem with the order
log(n),log(log(n)),nlog(n),n/log(n) respectively. Which is the best algorithm?
1. A1
2. A2
3. A3
4. A4
112. Which of the following algorithms exhibits the unusual behavior that, minimum numbers of
comparisons are needed if the list to be sorted is in the reverse order and maximum numbers of
comparisons are needed if they are already in sorted order?
1. Heap tree
2. Radix sort
3. Binary insertion sort
4. Selection sort
113. You want to check whether a given set of items is sorted. Which of the following sorting methods
will be the most efficient if it is already in sorted order?
1. bubble sort
2. selection sort
3. insertion sort
4. merge sort
114. The way a card game player arranges his cards as he picks them up one by one , is an example of
1. bubble sort
2. selection sort
3. insertion sort
4. merge sort
115. Which of the following sorting algorithm has the worst time complexity of nlog(n)?
1. Heap sort
2. Quick sort
3. Insertion sort
4. Selection sort
116. Which of the following sorting methods sorts a given set of items that is already in sorted order or in
reverse sorted order with equal speed?
1. Heap sort
2. Quick sort
3. Insertion sort
4. Selection sort
117. Which of the following sorting methods will be the best if number of swapping done, is the only
measure of efficiency?
1. bubble sort
2. insertion sort
3. selection sort
4. heap sort
http://targatenet.com/2017/03/23/data-structure-and-algorithms-mcq-gate-net-set-10/ 2/6
9/2/2017 DATASTRUCTURE AND ALGORITHMS MCQ GATE NET SET 10 | tarGATENET.COM
118. As part of the maintenance work, you are entrusted with the work of rearranging the library books
in a shelf in proper order, at the end of each day. The ideal choice will be
1. bubble sort
2. insertion sort
3. selection sort
4. heap sort
120. A machine took 200 sec to sort 200 names, using bubble sort. In 800 sec. it can approximately sort _
_ _ _ _ _ _ _ _ names
1. 400
2. 800
3. 750
4. 1600
129. Which of the following algorithm design technique is used in the quick sort algorithm?
1. Dynamic programming
2. Backtracking
3. Divide and conquer
4. Greedy method
131. A 3-ary tree in which every internal node has exactly 3 children. The number of leaf nodes in such a
tree with 6 internal nodes will be
1. 10
2. 17
3. 23
4. 13
132. Which of the following traversal techniques lists the nodes of a binary search tree in ascending
order?
1. post-order
2. In-order
3. Pre-order
4. No-order
133. A general linear list is a list in which operations, such as retrievals, insertions, changes, and
deletions can be done _ _ _ _ _ _ _ _ _
1. any where in the list
2. only at the beginning
3. only at the end
4. only at the middle
136. A binary tree has n leaf nodes. The number of nodes of degree 2 in this tree is
1. logn
2. n-1
3. n
4. 2n
http://targatenet.com/2017/03/23/data-structure-and-algorithms-mcq-gate-net-set-10/ 4/6
9/2/2017 DATASTRUCTURE AND ALGORITHMS MCQ GATE NET SET 10 | tarGATENET.COM
4. 2n nodes
138. The number of binary trees with 3 nodes which when traversed in post-order gives the sequence
A,B,C is
1. 3
2. 9
3. 7
4. 5
140. A binary tree in which every non-leaf node has non-empty left and right subtrees is called a strictly
binary tree.Such a tree with 10 leaves
1. cannot be more than 19 nodes
2. has exactly 19 nodes
3. has exactly 17 nodes
4. can not have more than 17 nodes
142. The depth of a complete binary tree with n nodes(log is to the base two)
1. log(n+1)-1
2. log(n)
3. log(n+1)+1
4. log(n)+1
http://targatenet.com/2017/03/23/data-structure-and-algorithms-mcq-gate-net-set-10/ 6/6