-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsorting.h
33 lines (23 loc) · 1.06 KB
/
sorting.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
//
// Zübeyr Furkan Eryilmaz
// 21202676
// CS 202 – 01
//
#ifndef CSS202ASSIGNMENT1_SORTING_H
#define CSS202ASSIGNMENT1_SORTING_H
class sorting
{
public:
sorting();
void selectionSort(int *arr, int size, long long &compCount, long long &moveCount);
void mergeSort( int *arr, int size, long long &compCount, long long &moveCount);
void quickSort( int *arr, int size, long long &compCount, long long &moveCount);
private:
void mergeSort(int *arr, int first, int last, long long &compCount, long long &moveCount);
void quickSort(int *arr, int first, int last, long long &compCount, long long &moveCount);
void swap(int &x, int &y, long long &moveCount);
int findLargestIndex(int * arr, int size, long long &compCount, long long &moveCount);
void partition(int *arr, int first, int last, int &pivotIndex, long long &compCount, long long &moveCount);
void merge(int *arr, int first, int mid, int last, long long &compCount, long long &moveCount);
};
#endif //CSS202ASSIGNMENT1_SORTING_H