-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.cpp
More file actions
executable file
·50 lines (41 loc) · 1.24 KB
/
Main.cpp
File metadata and controls
executable file
·50 lines (41 loc) · 1.24 KB
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
#include <iostream>
#include "Usefull.h"
#include "SelectionSort.h"
#include "BubbleSort.h"
#include "InsertionSort.h"
#include "MergeSort.h"
#include "QuickSort.h"
#include "HeapSort.h"
int main() {
int array1[] = {6, 5, 8, 3, 2, 1, 4, 7};
std::cout << "Selection Sort" << std::endl;
PrintArray(array1, 8);
SelectionSort(array1, 8);
PrintArray(array1, 8);
std::cout << "Bubble Sort" << std::endl;
int array2[] = {6, 5, 8, 3, 2, 1, 4, 7};
PrintArray(array2, 8);
BubbleSort(array2, 8);
PrintArray(array2, 8);
std::cout << "Insertion Sort" << std::endl;
int array3[] = {6, 5, 8, 3, 2, 1, 4, 7};
PrintArray(array3, 8);
InsertionSort(array3, 8);
PrintArray(array3, 8);
std::cout << "Merge Sort" << std::endl;
int array4[] = {6, 5, 8, 3, 2, 1, 4, 7};
PrintArray(array4, 8);
MergeSort(array4, 8);
PrintArray(array4, 8);
std::cout << "Quick Sort" << std::endl;
int array5[] = {6, 5, 8, 3, 2, 1, 4, 7};
PrintArray(array5, 8);
QuickSort(array5, 0, 7);
PrintArray(array5, 8);
std::cout << "Heap Sort" << std::endl;
int array6[] = {6, 5, 8, 3, 2, 1, 4, 7};
PrintArray(array6, 8);
HeapSort(array6, 8);
PrintArray(array6, 8);
return EXIT_SUCCESS;
}