| | | | | |

Iterator API (Syntax)

  • Tree iterators should be Bidirectional Iterators (exception: Levelorder is Forward)
  • Restrict access to data (especially pointers!)
  • Make external algorithms object-based, i.e., operate on object through public interface
  • Allow stopping in mid-traversal
  • Allow multiple iterators for a single container
  • Model: List <T>

Iterator Semantics

Preorder, Inorder, Postorder, Levelorder


| | Top of Page | 14. BST Iterators - 2 of 41