Explore topic-wise MCQs in Data Structures and Algorithms.

This section includes 5 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.

1.

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
C. The tree can be modified and you should know the number of elements in the tree before hand, it improves the deletion time
D. The tree should be just modified and improves the lookup time
Answer» B. You should know the frequency of access of the keys, improves the lookup time
2.

What are the worst case and average case complexities 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)
Answer» E.
3.

Preorder_traversal$

A. Inorder traversal
B. Postorder traversal
C. Level order traversal
Answer» B. Postorder traversal
4.

What is the speciality about the inorder traversal of a binary search tree?

A. It traverses in a non increasing order
B. It traverses in an increasing order
C. It traverses in a random fashion
D. None of the mentioned
Answer» B. It traverses in an increasing order
5.

Which of the following is false about a binary search tree?

A. The left child is always lesser than its parent
B. The right child is always greater than its parent
C. The left and right sub-trees should also be binary search trees
D. None of the mentioned
Answer» E.