| | | | | |

Recap: BST Lite

  • T& Get(t)
    1. Multiple Personalities
    2. Behaves like retrieval with succesful search
    3. Behaves like insert + retrieve with unsuccessful search
    4. Always returns valid reference to t in tree - Lvalue
  • void Put(t)
    1. Call Get(t)
    2. Assign new value
    3. Get(t) = t
  • bool Retrieve(t) const
    1. const search method - use when you don't want insertion
    2. if found, sets t to result and returns true
    3. if not found, returns false and does not change t
  • void Traverse(F f)
    1. Inorder Traversal
    2. Applies function object f to each value
    3. Needed - lack of iterators
  • Iterators not required

| | Top of Page | 12. Binary Search Trees - 14 of 27