2023-01-12 13:32:19 -06:00
|
|
|
#include "sorts.h"
|
|
|
|
#include <iostream>
|
|
|
|
#include <fstream>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
void Sorter::SetFileName(std::string newName)
|
|
|
|
{
|
|
|
|
this->filename = newName;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Sorter::GetFileName(void)
|
|
|
|
{
|
|
|
|
return this->filename;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sorter::SetWordList(void)
|
|
|
|
{
|
|
|
|
std::string bufferStr;
|
|
|
|
std::ifstream file(this->filename);
|
|
|
|
if (!file.is_open())
|
|
|
|
{
|
|
|
|
std::cout << "Failed opening file\n";
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
while (getline(file, bufferStr))
|
|
|
|
wordList.push_back(bufferStr);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sorter::InsertionSort(void)
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sorter::MergeSort(void)
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Sorter::HeapSort(void)
|
|
|
|
{
|
|
|
|
;
|
|
|
|
}
|