Inorder traversal of a binary tree using the iterator pattern