The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+13 votes
3.1k views

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)?

  1. $2$
  2. $3$
  3. $4$
  4. $6$
asked in DS by Veteran (59.5k points)
edited by | 3.1k views

6 Answers

+22 votes
Best answer

Height is 3

answered by Veteran (60.4k points)
selected by
+6 votes

ans is (b)

answered by Active (5k points)
+5 votes
Ans) 3

Draw a BST for the given numbers And the Distance from root(i.e 10) to leaf(i.e 5) is 3.
answered by Active (4.7k points)
+4 votes
ans will be 3 . hence option (b)
answered by
–1 vote
ans b)
answered by Active (5.2k points)
–3 votes
Why not height at root considered as 0
As per that the height is 2
Please correct me
answered by Junior (541 points)
+1
Read definition of height of tree ... which is # of longest edges from root to leaves .... and  height of node ... which is # of longest edges from that node to leaves ....
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

38,113 questions
45,620 answers
132,318 comments
49,301 users