-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.h
More file actions
53 lines (43 loc) · 1.65 KB
/
Array.h
File metadata and controls
53 lines (43 loc) · 1.65 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
51
52
53
/* ========================================================================= *
* Array generator
* ========================================================================= */
#ifndef _ARRAY_H_
#define _ARRAY_H_
#include <stddef.h>
/* ------------------------------------------------------------------------- *
* Create a sorted array of integers.
*
* The array must later be deleted by calling free().
*
* PARAMETERS
* length Number of elements in the array (pre-condition: 0 < length)
*
* RETURN
* array A new array of integers, or NULL in case of error
* ------------------------------------------------------------------------- */
int* createSortedArray(size_t length);
/* ------------------------------------------------------------------------- *
* Create a decreasing array of integers.
*
* The array must later be deleted by calling free().
*
* PARAMETERS
* length Number of elements in the array (pre-condition: 0 < length)
*
* RETURN
* array A new array of integers, or NULL in case of error
* ------------------------------------------------------------------------- */
int* createDecreasingArray(size_t length);
/* ------------------------------------------------------------------------- *
* Create a random array of integers (from 0 to length-1).
*
* The array must later be deleted by calling free().
*
* PARAMETERS
* length Number of elements in the array (pre-condition: 0 < length)
*
* RETURN
* array A new array of integers, or NULL in case of error
* ------------------------------------------------------------------------- */
int* createRandomArray(size_t length);
#endif // !_ARRAY_H_