-
Notifications
You must be signed in to change notification settings - Fork 2
/
sort.h
30 lines (26 loc) · 837 Bytes
/
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
#ifndef _SORT_H_
#define _SORT_H_
#include <vector>
#include <list>
namespace amo {
class Sort {
private:
static Sort* instance;
Sort();
~Sort();
public:
static Sort& getInstance();
std::vector<int> getRandomShuffledVector(int n);
void bubbleSort(std::vector<int>& vector);
std::vector<int> merge(std::vector<int>& left, std::vector<int>& right);
void merge(std::vector<int>& partial_sorted_vector, int front, int mid, int end);
std::vector<int> mergeSort(std::vector<int>& vector);
void mergeSort(std::vector<int>& vector, int front, int end);
void selectionSort(std::vector<int>& vector);
void insertionSort(std::vector<int>& vector);
void quickSort(std::vector<int>& vector);
void quickSort(std::vector<int>& vector, int front, int end);
int reverse(std::list<int>& list);
};
};
#endif