What is Depth-first pre-order.
Visit the root then the sub-trees.
What is Depth-first post-order.
Visit the sub-trees and then the root.
What is Depth-first in-order.
This is usually for Binary Trees where there are two
sub-trees. Visit the left sub-tree, then the root and then the
right sub-tree.
Recursive procedure for finding height of tree.
public int getHeight(BinaryTree n){
if (n == null){
return 0;
}
return max(getHeight(n.getLeft()), getHeight(n.getRight()) + 1;
}