ProjectEuler and ThreadedBinaryTree