-
Notifications
You must be signed in to change notification settings - Fork 0
/
sorts.h
31 lines (23 loc) · 816 Bytes
/
sorts.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
#include <algorithm>
#include <iostream>
#include <vector>
#include <random>
#include <cmath>
class Sorts {
private:
// Helper Functions
static void mergeSortHelper(std::vector<int> &arr, int left, int mid, int right);
static int quickSortHelper(std::vector<int> &arr, int left, int right);
static void quickSort(std::vector<int> &arr, int left, int right);
public:
// Insertion Sort
static void insertionSort(std::vector<int> &arr);
// Merge Sort
static void mergeSort(std::vector<int> &arr);
static void mergeSort(std::vector<int> &arr, int left, int right);
// QuickSort
static void quickSort(std::vector<int> &arr);
// radix sort methods
static void radixSort(std::vector<int> &arr);
static void radixSort(std::vector<int> &arr, int maxDigits);
};