Let and be the and the number of nodes in a BST (Binary Search Tree) of length (or height) 3 respectively. Find the value of
Details and Assumptions:
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
A BST of height h is a two-way tree, which means it has some nodes such that each node has at most two children or no child. Hence m i n = h + 1 and m a x = 2 h + 1 − 1 . Therefore a BST of height 3 has minimum 4 and maximum 2 3 + 1 − 1 = 2 4 − 1 = 1 6 − 1 = 1 5 nodes. Hence m i n + m a x = 4 + 1 5 = 1 9