Salesforce Interview Question

Q: Implement the preorder, inorder and postorder traversals without using stack or recursion