-
Notifications
You must be signed in to change notification settings - Fork 0
/
volsort.h
40 lines (27 loc) · 1.25 KB
/
volsort.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
38
39
40
// volsort.h
//jay ashworth and andy zeng
//Using 4 different sorting algorithms and see what theroretical and actual difference is in each one
#ifndef VOLSORT_H
#define VOLSORT_H
#include <string>
struct Node {
std::string string;
int number;
Node *next;
};
struct List {
Node *head;
size_t size;
List(); // define in list.cpp
~List(); // define in list.cpp
void push_front(const std::string &s); //define below
};
// Functions -------------------------------------------------------------------
bool node_number_compare(const Node *a, const Node *b); //implement in this file (volsort.h), used by quick, merge and stl
bool node_string_compare(const Node *a, const Node *b); //implement in this file (volsort.h), used by quick, merge and stl
void dump_node(Node *n); // implement in this file (volsort.h) to make it easier for TAs to grade
void stl_sort(List &l, bool numeric); // define in stl.cpp - sort using std::sort
void qsort_sort(List &l, bool numeric); // define in qsort.cpp - sort using qsort from cstdlib
void merge_sort(List &l, bool numeric); // define in merge.cpp - your implementation
void quick_sort(List &l, bool numeric); // define in quick.cpp - your implementation
#endif