This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gitignore templates |
Q: Via Quora
Given the set of keys {6, 7, 1, 4, 2}, how many unique binary search trees of height 2 are possible? Draw the trees. Assume that the height of the root-node is zero.
A:
There are 6 unique Binary Search Trees (BST) of height 2 that can be constructed from the key set
$\{ 6, 7, 1, 4, 2 \}$ when all keys are used. Furthermore, there are 36 total BSTs of height 2 that can be constructed from said key set.