Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef TREETYPE_H
- #define TREETYPE_H
- #include <string>
- #include <fstream>
- #include "QueType.h"
- #include <vector>
- typedef char ItemType;
- struct TreeNode;
- enum OrderType {PRE_ORDER, IN_ORDER, POST_ORDER};
- class TreeType
- {
- public:
- TreeType();
- ~TreeType();
- TreeType(const TreeType& originalTree);
- ItemType GetItem(ItemType item, bool& found);
- void PutItem(ItemType item);
- void DeleteItem(ItemType item);
- int GetLength() const;
- bool IsEmpty() const;
- bool IsFull() const;
- void Print(std::ofstream& outFile) const; //void Print(std::ostream& out) const;
- void ResetTree(OrderType order);
- ItemType GetNextItem(OrderType order, bool& finished);
- void MakeEmpty();
- void operator=(const TreeType& originalTree);
- bool IsFullTree();
- bool IsBST();
- int GetNodesAtLevel (std::vector<ItemType> itemArray, int level);
- void PrintAncestors (ItemType value);
- void GetSmallest (ItemType & smallest);
- void GetSuccessor(ItemType& data);
- private:
- TreeNode* root;
- QueType preQue;
- QueType inQue;
- QueType postQue;
- };
- #endif // TREETYPE_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement