// BSTiter.h // Class header file for binary search tree with iterator class // Incomplete file // Sections to be completed marked with comments beginning //***** #ifndef _BSTITER_H #define _BSTITER_H #include "BST.h" #include "stack.h" class BSTWithIter : public bstClass { public: class iterator { friend class BSTWithIter; // so begin() can access Cur. public: // declarations for iterator methods // default constructor; creates an iterator initialized to end() iterator(); // copy constructor iterator(const iterator& Iter); // operator =; returns reference to iterator iterator& operator= (const iterator& RHS); // operator *; unary operator to dereference, return const reference const itemClass operator* () const; //operator ++; both pre- and postincrement; return const copy const iterator operator++ (); const iterator operator++ (int); // operator ==; compare two iterators for equality bool operator==(const iterator& RHS) const; // operator !=; compare two iterators for inequality bool operator!=(const iterator& RHS) const; private: ptrType Cur; stack S; }; // new BSTWithIter methods begin and end // ***** ADD HEADERS HERE ***** };