#ifndef AVL_TREE_ENUMERATOR #define AVL_TREE_ENUMERATOR #include #include "Enumerator.h" #include "AVLTreeOrder.h" #include "AVLTree.h" template class AVLTreeEnumerator : public Enumerator { private: AVLTreeOrder order; std::stack*> traversalStack; void buildTraversalStack(const AVLTree* current); public: AVLTreeEnumerator(const AVLTree* root, AVLTreeOrder order); virtual ~AVLTreeEnumerator(); bool hasNext() const; T next(); // throws ExceptionEnumerationBeyondEnd if no next item is available T peek() const; // throws ExceptionEnumerationBeyondEnd if no next item is available AVLTreeOrder getOrder(); // returns the order of this enumerator (preorder, inorder, or postorder) }; // put implementation here #endif // !AVL_TREE_ENUMERATOR