forked from mihaicfx/utcn-fa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquick_sort.h
76 lines (64 loc) · 2.18 KB
/
quick_sort.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef __QUICK_SORT_H__
#define __QUICK_SORT_H__
#include "Profiler.h"
#include "commandline.h"
namespace lab03
{
/**
* @brief Quick sort algorithm
*
* @param values array of input values to be sorted
* @param n number of values in the input array
* @param opAsg optional counter for assignment operations
* @param opCmp optional counter for comparison operations
*/
void quickSort(int* values, int n, Operation* opAsg = nullptr, Operation* opCmp = nullptr);
/**
* @brief Hybridized Quick sort algorithm
*
* @param values array of input values to be sorted
* @param n number of values in the input array
* @param opAsg optional counter for assignment operations
* @param opCmp optional counter for comparison operations
*/
void hybridizedQuickSort(int* values, int n, Operation* opAsg = nullptr, Operation* opCmp = nullptr);
/**
* @brief Quick select algorithm
*
* @param values array of input values to be sorted
* @param n number of values in the input array
* @param opAsg optional counter for assignment operations
* @param opCmp optional counter for comparison operations
*/
void quickSelect(int* values, int n, Operation* opAsg = nullptr, Operation* opCmp = nullptr);
/**
* @brief Heap sort algorithm
*
* @param values array of input values to be sorted
* @param n number of values in the input array
* @param opAsg optional counter for assignment operations
* @param opCmp optional counter for comparison operations
*/
void heapSort(int* values, int n, Operation* opAsg = nullptr, Operation* opCmp = nullptr);
/**
* @brief Demo code for the sorting algorithms
*
* @param size number of elements to demonstrate on
*/
void demonstrate(int size);
/**
* @brief Performance analysis for the sorting algorithms
*
* @param profiler profiler to use
* @param whichCase one of AVERAGE, BEST or WORST cases
*/
void performance(Profiler& profiler, AnalysisCase whichCase);
/**
* @brief Benchmarking for the sorting algorithms
*
* @param profiler profiler to use
* @param whichCase one of AVERAGE, BEST or WORST cases
*/
void benchmark(Profiler& profiler, AnalysisCase whichCase);
} // namespace lab03
#endif // __QUICK_SORT_H__