calculate the height of binary tree