| | | | | |

class BSTLite

  template <typename T, class P = LessThan<T> >
  class BST
  {
  public:
    ...
    T&   Get       (const T& t);
    void Put       (const T& t);
    bool Retrieve  (T& t) const;
    void Erase     (const T& t);  // more on this later

    template < class F >
    void Traverse  (F f) const;
    ...
  protected:
    class Node
    {
      T             value_;
      Node *        lchild_;
      Node *        rchild_;
      Node (const T& t) : value_(t), lchild_(0), rchild_(0) {}
      friend class BST<T,P>;
    };
    Node *        root_;
    PredicateType pred_;
  };

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