# Data Structures and Algorithms Multiple Choice Questions - Set 1

1.       In the deletion operation of max heap, the root is replaced by:
(A) next available value in the left sub-tree.
(B) next available value in the right sub-tree.
(C) first element of the last level
(D) last element of the last level
2.       Which of the following algorithm does not divide the list?
(A) merge sort
(B) binary search
(C) linear search
(D) quick sort
3.       At most, how many comparisons are required to search a sorted vector of 1023 elements using the binary search algorithm?
(A) 10
(B) 15
(C) 20
(D) 30
4.       For implementing recursive function the data structure used is:
(A) Stack
(B) Queue
(D) Tree
Explanation:
For implementing recursive function, stack is used as a data structure.
5.       Which of the following is an example of in-place algorithm?
(A) Bubble Sort
(B) Merge Sort
(C) Insertion Sort
(D) None of the above

6.       The postfix form of the following infix notation is : (A + B)* (C*D − E)* F
(A) AB + CD*E − *F*
(B) AB+ CDE + − * F*
(C) AB+ CD − EF + − **
(D) ABCDEF* − + * +
7.       The number of nodes in a complete binary tree of depth d (with root at depth 0) is
(A) 2d−1 +1
(B) 2d+1 -1
(C) 2d−1 -1
(D) 2d+1 +1
8.       What are the sequence of popped out values if the sequence of operations - push(1), push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop are performed on a stack.
(A) 2, 2, 1, 1, 2
(B) 2, 2, 1, 2, 2
(C) 2, 1, 2, 2, 1
(D) 2, 1, 2, 2, 2
9.       In conversion from prefix to postfix using stack data-structure, if operators and operands are pushed and popped exactly once, then the run-time complexity is ............
(A) Ο(1)
(B) Ο(n)
(C) Ο(log n)
(D) Ο(n2)