-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy patharray.h
More file actions
executable file
·64 lines (56 loc) · 1.76 KB
/
array.h
File metadata and controls
executable file
·64 lines (56 loc) · 1.76 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
54
55
56
57
58
59
60
61
62
63
64
/*
* =====================================================================================
*
* Filename: array.h
*
* Description:
*
* Compiler: nvcc V6.0.1
*
* Author: Eugenio Pacceli Reis da Fonseca
* Icaro Harry
*
* Organization: DCC/UFMG
*
* =====================================================================================
*/
#ifndef ARRAY_OPERATIONS
#define ARRAY_OPERATIONS 1
#define RANDOM_ORDER 0
#define ASCENDING_ORDER 1
#define DESCENDING_ORDER 2
#define ALMOST_ORDERED 3
/**
* Function that fills an array with random integers
* @param int* array Reference to the array that will be filled
* @param int size Number of elements
*/
void random_array(int *array, int size);
/**
* Function that fills an array with integers in ascending order
* @param int* array Reference to the array that will be filled
* @param int size Number of elements
*/
void ascending_array(int *array, int size);
/**
* Function that fills an array with integers in ascending order
* @param int* array Reference to the array that will be filled
* @param int size Number of elements
*/
void descending_array(int *array, int size);
/**
* Function that fills 90% of an array with integers in ascending order
* an the other 10% with random integers
* @param int* array Reference to the array that will be filled
* @param int size Number of elements
*/
void almost_ordered_array(int *array, int size);
/**
* Function that receives the size and the organization of the
* required array and returns it filled.
* @param int size Size of the array
* @param int organization How the array will be filled
* @return int[] Filled array
*/
int* generate_array(int size, int organization);
#endif