height of binary tree algorithm