I have the following text from an academic course I took a while ago about inorder traversal (they also call it pancaking) of a binary tree (not BST):
Forget the definitions, it's so much easier to just apply the algorithm:
void inOrderPrint(Node root) { if (root.left != null) inOrderPrint(root.left); print(root.name); if (root.right != null) inOrderPrint(root.right); }
It's just three lines. Rearrange the order for pre- and post- order.