The best way to calculate the height in a binary search tree? (balancing an AVL-tree)
Part 1 – height As starblue says, height is just recursive. In pseudo-code: height(node) = max(height(node.L), height(node.R)) + 1 Now height could be defined in two ways. It could be the number of nodes in the path from the root to that node, or it could be the number of links. According to the page … Read more