master
Design an algorithm for the following operations for a binary tree BT, and show the worst-case running times for each implementation:
- preorderNext(x): return the node visited after node x in a pre-order traversal of BT.
- postorderNext(x): return the node visited after node x in a post-order traversal of BT.
- inorderNext(x): return the node visited after node x in an in-order traversal of BT.