Top 350+ Solved Data Structures (DS) MCQ Questions Answer
Q. A self – balancing binary search tree can be used to implement
a. Priority queue
b. Hash table
c. Heap sort
d. Priority queue and Heap sort
Q. In which of the following self – balancing binary search tree the recently accessed element can beaccessed quickly?
a. AVL tree
b. AA tree
c. Splay tree
d. Red – Black tree
Q. The minimum height of self balancing binary search tree with n nodes is
a. log2(n)
b. n
c. 2n + 1
d. 2n – 1
Q. What is an AVL tree?
a. a tree which is balanced and is a height balanced tree
b. a tree which is unbalanced and is a height balanced tree
c. a tree with three children
d. a tree with atmost 3 children
Q. Why we need to a binary tree which is height balanced?
a. to avoid formation of skew trees
b. to save memory
c. to attain faster memory access
d. to simplify storing
Q. Given an empty AVL tree, how would you construct AVL tree when a set of numbers are givenwithout performing any rotations?
a. just build the tree with the given input
b. find the median of the set of elements given, make it as root and construct the tree
c. use trial and error
d. use dynamic programming to build the tree
Q. What maximum difference in heights between the leafs of a AVL tree is possible?
a. log(n) where n is the number of nodes
b. n where n is the number of nodes
c. 0 or 1
d. atmost 1
Q. What is missing?
a. Height(w-left), x-height
b. Height(w-right), x-height
c. Height(w-left), x
d. Height(w-left)
Q. Why to prefer red-black trees over AVL trees?
a. Because red-black is more rigidly balanced
b. AVL tree store balance factor in every node which costs space
c. AVL tree fails at scale
d. Red black is more efficient
Q. Which of the following is the most widely used external memory data structure?
a. AVL tree
b. B-tree
c. Red-black tree
d. Both AVL tree and Red-black tree
Q. B-tree of order n is a order-n multiway tree in which each non-root node contains
a. at most (n – 1)/2 keys
b. exact (n – 1)/2 keys
c. at least 2n keys
d. at least (n – 1)/2 keys
Q. 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