Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma region Node Structure
- struct Node
- {
- int info;
- Node* left;
- Node* right;
- Node() : info(0), left(nullptr), right(nullptr) {};
- Node(int _info) : info(_info), left(nullptr), right(nullptr) {};
- };
- #pragma endregion
- #pragma region BT
- class BT
- {
- public:
- BT();
- void PreOrderR();
- void PreOrder();
- void InOrder();
- void PostOrder();
- int GetNumberNodes();
- int GetNumberNodesR();
- int Height();
- ~BT();
- private:
- Node* root;
- int GetNumberNodesR(Node* n
- );
- void PreOrderR(Node* n);
- void InOrder(Node* n);
- void PostOrder(Node* n);
- int Height(Node* n);
- void DestroyTree(Node* n);
- };
- #pragma endregion
- #pragma region BST
- class BST
- {
- public:
- BST();
- Node* Search(int _key);
- Node* SearchR(int _key, Node* _n);
- void Insert(int _key);
- void InsertR(int _key, Node* _n);
- bool Exist(int _key);
- bool ExistR(int _key, Node* _n);
- ~BST();
- private:
- Node* root;
- };
- #pragma endregion
- #pragma region Graph
- typedef int vertex;
- typedef std::pair<int, int> edge;
- class Graph
- {
- std::map<int, std::vector<int>> g;
- public:
- Graph();
- Graph(Graph* _gExtern);
- Graph(std::vector<edge> _el);
- void Insert(edge);
- void Remove(edge);
- bool Path(vertex _initial, vertex _final);
- void Print();
- bool isEulerian();
- int Index(vertex _e);
- ~Graph();
- private:
- };
- #pragma endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement