Data Structures and Algorithms Multiple Choice Questions - Set 22

211.       In a linked list with n nodes, the time taken to insert an element after an element pointed by some pointer is ..............
(A) O(1)
(B) O(log n)
(C) O(n)
(D) O(n 1og n)
Answer: A
212.       The data structure required to evaluate a postfix expression is ...........
(A) Queue
(B) Stack
(C) Array
(D) linked-list
Answer: B
213.       The data structure required to check whether an expression contains balanced parenthesis is ............
(A) Stack
(B) Queue
(C) Tree
(D) Array
Answer: A
214.       The complexity of searching an element from a set of n elements using Binary search algorithm is ............
(A) O(n)
(B) O(log n)
(C) O(n2)
(D) O(n log n)
Answer: B
215.       Which of the sorting techniques has highest best-case runtime complexity?
(A) Quick sort
(B) Selection sort
(C) Insertion sort
(D) Bubble sort
Answer: B
216.       The number of leaf nodes in a complete binary tree of depth d is ...........
(A) 2d
(B) 2d–1+1
(C) 2d+1+1
(D) 2d+1
Answer: A
217.       A circular linked list can be used for ..............
(A) Stack
(B) Queue
(C) Both Stack & Queue
(D) Neither Stack or Queue
Answer: C
218.       What data structure would you mostly likely see in a non-recursive implementation of a recursive algorithm?
(A) Stack
(B) Linked list
(C) Queue
(D) Trees
Answer: A
219.       Which of the following sorting methods would be most suitable for sorting a list which is almost sorted?
(A) Bubble Sort
(B) Insertion Sort
(C) Selection Sort
(D) Quick Sort
Answer: A
220.    A B-tree of minimum degree t can maximum ............... pointers in a node.
(A) t–1
(B) 2t–1
(C) 2t
(D) t
Answer: D


Post a Comment

0 Comments