-
Notifications
You must be signed in to change notification settings - Fork 0
/
SortingCompetition.h
37 lines (30 loc) · 1008 Bytes
/
SortingCompetition.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef SORTINGCOMPETITION_H
#define SORTINGCOMPETITION_H
#include <string>
#include <vector>
#include <fstream>
#include <cstring>
/*authored by David Kim and JD Francis*/
using namespace std;
class SortingCompetition
{
public:
SortingCompetition(const string&);
void setFileName(const string&);
bool readData();
bool prepareData();
void sortData();
void outputData(const string&);
~SortingCompetition();
private:
void quickSortOmp(char**, int); //quick sort implementation
int QsPartition(char**, int, int);
void QsSequential(char**, int, int);
void QuickSortOmpTask(char**, int, int, const int);
vector<char*> prePrepare; //vector that reads in file data
ifstream fin;
char** lenarray; //array for length prefixed strings
int getpstrlen(char*); //gets length of length prefixed string
int pstrcmp(char*, char*); //compares two length prefixed strings
};
#endif // SORTINGCOMPETITION_H