algorithm - Getting the Average Height of a Binary Search Tree -
i have come problem statement tree in form:
4 2 6 1 3 5 7
it said average height 1.4285715
based know, average height of tree sum of height of each node divided total number of nodes. getting different result. need hint on how value 1.4285715 computed.
use formula ans set root depth 0: (0 + 1 + 1 + 2 + 2 + 2 + 2) / 7 = 10 / 7 = 1.4285715
.
Comments
Post a Comment