Adding tree traversal algorithms.