Given the following condition, how can we determine if it is a self balancing BST?

83 Views Asked by At

By the definition of a self-balancing BST, the height of the children should = Big-Theta(logn).

How can I check if a BST is self-balancing given the following condition? No. of nodes in its left subtree and right subtree are no more than 90% of the total number of nodes in its subtree (incl. the node itself).

1

There are 1 best solutions below

0
Matt Timmermans On

Yes, if you can ensure that every subtree is at most 90% the size of its parent, then the height of tree can be at most -log(n)/log(.9).