Separated sorts into separate namespace
This commit is contained in:
+18
-10
@@ -14,7 +14,6 @@ private:
|
||||
int lineCount;
|
||||
std::vector<std::string> originalWordList;
|
||||
std::chrono::duration<double> sortTime;
|
||||
int heapSize; // Heap Sort only
|
||||
public:
|
||||
Sorter();
|
||||
std::vector<std::string> newWordList;
|
||||
@@ -29,17 +28,26 @@ public:
|
||||
void OutputResult(void);
|
||||
void PrintSortTime(std::string outputFilename);
|
||||
void PrintToFile(std::string outputFilename);
|
||||
void InsertionSort(void);
|
||||
void MergeSort(void);
|
||||
void __MergeSort__(int p, int r);
|
||||
void __Merge__(int p, int q, int r);
|
||||
void HeapSort(void);
|
||||
void __HeapSort__(void);
|
||||
void __Heapify__(int i);
|
||||
int __LEFT__(int i);
|
||||
int __RIGHT__(int i);
|
||||
};
|
||||
|
||||
void CheckArguments(int argc, char* arguments[], Sorter* sortObj);
|
||||
|
||||
namespace ImplementedSort
|
||||
{
|
||||
// Performs Insertion Sort on given word list (vector of strings)
|
||||
void InsertionSort(std::vector<std::string> *newWordList);
|
||||
|
||||
// Performs Merge Sort on given word list (vector of strings)
|
||||
void MergeSort(std::vector<std::string> *newWordList);
|
||||
void __MergeSort__(std::vector<std::string> *newWordList, int p, int r);
|
||||
void __Merge__(std::vector<std::string> *newWordList, int p, int q, int r);
|
||||
|
||||
// Performs Heap Sort on given word list (vector of strings)
|
||||
void HeapSort(std::vector<std::string> *newWordList);
|
||||
void __HeapSort__(std::vector<std::string> *newWordList);
|
||||
void __Heapify__(std::vector<std::string> *newWordList, int i, int heapSize);
|
||||
int __HEAPSORT_LEFT__(int i);
|
||||
int __HEAPSORT_RIGHT__(int i);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user