master
..
rw-r--r--
655 B
rw-r--r--
399 B
rw-r--r--
2.0 KB
rw-r--r--
665 B
rw-r--r--
11.5 KB
rw-r--r--
1.0 KB

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.