Tree traversal algorithms for a binary tree