| | | | | |

Levelorder Iterator Incrementation (Queue Based)

  template < class C >
  void LevelorderBTIterator<C>::Increment()
   {
    if ( que_.Empty() )
      return;
    Node * n = que_.Front();
    que_.Pop();
    if (n->HasLeftChild()) que_.Push(n->lchild_);
    if (n->HasRightChild()) que_.Push(n->rchild_);
  }

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