Question 13Asked in UGC NET Computer Science, November 2017 (Paper II & III, Selected Questions)

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?

  1. A3
  2. B4
  3. C5
  4. D6
Show answerHide answer

Correct answer: (A) 3

Explanation

Inserting 10, 1, 3, 5, 15, 12, 16: 10 is the root; 1 is its left child, 3 is the right child of 1 and 5 is the right child of 3; 15 is the right child of 10 with children 12 and 16. The longest root-to-leaf path is 10-1-3-5 with 3 edges, so the height is 3.

From UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions)

This is question 13 of UGC NET Computer Science PYQ, November 2017 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.