-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsortfuncts.h
executable file
·43 lines (38 loc) · 1.35 KB
/
sortfuncts.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
/**
* ===========================================================
* Name:
* Section:
* Project: Quick Sort
* ===========================================================
*/
#ifndef SORT_H
#define SORT_H
// constant representing size of input
#define N 8
// function prototypes
/** -------------------------------------------------------------------
* @brief Perform a quick sort on a portion of an array, from lBound
* to rBound
* @param array - the array to sort
* @param lBound - the starting index of the sublist to sort
* @param rBound - the ending index of the sublist to sort
* @pre parameters are populated with proper values
* @post numbers is sorted
*/
void quickSort(int array[], int lBound, int rBound);
/** -------------------------------------------------------------------
* @brief Fills an array with random values between 0 and 29
* @param array - the array to fill
* @pre numbers has been allocated
* @post array is filled with random numbers
*/
void fillArray(int array[]);
/** -------------------------------------------------------------------
* @brief Prings an array
* @param nums - the array to print
* @param n - items in list
* @pre numbers has been allocated and initialized
* @post array is printed nums is unmodified
*/
void printArray(int nums[], int n);
#endif // LAB09_H