Finished main part of RBT and BST

This commit is contained in:
2023-03-06 22:24:59 -06:00
parent 226bf8587a
commit a5e494baa1
4 changed files with 21 additions and 8 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ enum SortType {INSERTION = 0, MERGE, HEAP, BST, RBT, LAST};
class SortController
{
public:
std::ofstream outputFile;
SortController();
void CheckArguments(int argc, char* arguments[]);
void ReadWordFile(void);
@@ -19,6 +20,7 @@ public:
void SetFilename(std::string name);
std::string GetFilename(void);
void SetOutput(std::string filename);
bool IsOutputSpecified(void);
void TestInsertion(void);
void TestMerge(void);
void TestHeap(void);
@@ -45,7 +47,6 @@ protected:
;
private:
std::string filename;
std::ofstream outputFile;
SortType currentType;
std::string wordToLocate;
tree_implementation::BinarySearchTree binarySearchTree;
+1 -1
View File
@@ -46,7 +46,7 @@ namespace tree_implementation
void Search(std::string key);
std::shared_ptr<TreeNode> GetNodeWithWord(std::string wordToFind);
void InOrderTreeTraversal(std::shared_ptr<TreeNode> viewedNode);
void InOrderTreeTraversal(std::shared_ptr<TreeNode> viewedNode, std::ofstream file);
void InOrderTreeTraversal(std::shared_ptr<TreeNode> viewedNode, std::ofstream* file);
void PrintParentKey(std::string key);
void PrintLeftChild(std::string key);
void PrintRightChild(std::string key);