-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSorting.h
More file actions
22 lines (20 loc) · 719 Bytes
/
Sorting.h
File metadata and controls
22 lines (20 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
#define MAX_ARRAY 10000
#define aType int
//SELECTION PROTOTYPES
void SelectionSort(aType A[], int nElements, int& c, int& s);
int IndexOfSmallest(aType A[], int iStart, int iEnd, int& c);
//QUICK PROTOTYPES
void Quicksort(aType a[], int first, int last, int& c, int& s);
int Pivot(aType a[], int first, int last, int& c, int& s);
void Swap(aType& v1, aType& v2, int& s);
//MERGE PROTOTYPES
void Mergesort(aType a[], int first, int last, int& c, int& s);
void Merge(aType a[],
int firstLeft, int lastLeft,
int firstRight, int lastRight, int& c, int& s);
void PrintArray(aType A[], int nElements);
//END PROTOTYPES