• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Binary Search Tree (BST) Data Structure with Answers

Question 31

Suppose that we have numbers between 1 and 1,000 in a binary search tree and want to search for the number 364. Which of the following sequences could not be the sequence of nodes examined ?
  • 925, 221, 912, 245, 899, 259, 363, 364
  • 3, 400, 388, 220, 267, 383, 382, 279, 364
  • 926, 203, 912, 241, 913, 246, 364
  • 3, 253, 402, 399, 331, 345, 398, 364

Question 32

The number of disk pages access in B - tree search, where h is height, n is the number of keys, and t is the minimum degree, is:

  • θ(logn h * t)

  • θ(logt n * h)

  • θ(logh n)

  • θ(logt n)

Question 33

How many distinct binary search trees can be created out of 4 distinct keys?

  • 5

  • 14

  • 24

  • 35

Question 34

The preorder traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the postorder traversal of the tree ?
  • 10, 11, 12, 15, 16, 18, 19, 20
  • 11, 12, 10, 16, 19, 18, 20, 15
  • 20, 19, 18, 16, 15, 12, 11, 10
  • 19, 16, 18, 20, 11, 12, 10, 15

Question 35

In a balanced binary search tree with n elements, what is the worst-case time complexity of reporting all elements in the range [a,b]? Assume that the number of reported elements is k.

  • Θ(log n)

  • Θ(log(n)+k)

  • Θ(k log n)

  • Θ(n log k)

Question 36

Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree?
  • 7 5 1 0 3 2 4 6 8 9
  • 0 2 4 3 1 6 5 9 8 7
  • 0 1 2 3 4 5 6 7 8 9
  • 9 8 6 4 2 3 0 1 5 7

Question 37

The average depth of a binary search tree is:
  • O(n0.5)
  • O(n)
  • O(log n)
  • O(n log n)

Question 38

When searching for the key value 60 in a binary search tree, nodes containing the key values 10, 20, 40, 50, 70 80, 90 are traversed, not necessarily in the order given. How many different orders are possible in which these key values can occur on the search path from the root to the node containing the value 60?
  • 35
  • 64
  • 128
  • 5040

Question 39

The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root)?
  • 2
  • 3
  • 4
  • 6

Question 40

The postorder traversal of a binary tree is 8, 9, 6, 7, 4, 5, 2, 3, 1. The inorder traversal of the same tree is 8, 6, 9, 4, 7, 2, 5, 1, 3. The height of a tree is the length of the longest path from the root to any leaf. The height of the binary tree above is ________ . Note -This was Numerical Type question.
  • 2
  • 3
  • 4
  • 5

There are 41 questions to complete.

Last Updated :
Take a part in the ongoing discussion