Algorithms_in_C
1.0.0
Set of algorithms implemented in C.
dynamic_array.h
1
#ifndef __DYNAMIC_ARRAY__
2
#define __DYNAMIC_ARRAY__
3
#define DEFAULT_CAPACITY 1 << 4
4
#define INDEX_OUT_OF_BOUNDS NULL
5
6
typedef
struct
dynamic_array
7
{
8
void
**items;
9
unsigned
size;
10
unsigned
capacity;
11
}
dynamic_array_t
;
12
13
extern
dynamic_array_t
*init_dynamic_array();
14
15
extern
void
*add(
dynamic_array_t
*da,
const
void
*value);
16
17
extern
void
*put(
dynamic_array_t
*da,
const
void
*value,
unsigned
index);
18
19
extern
void
*get(
dynamic_array_t
*da,
const
unsigned
index);
20
21
extern
void
delete
(
dynamic_array_t
*da,
const
unsigned
index);
22
23
unsigned
contains(
const
unsigned
size,
const
unsigned
index);
24
25
extern
void
*retrive_copy_of_value(
const
void
*value);
26
27
#endif
Dict
Definition:
dict.h:18
main
int main()
Driver code.
Definition:
client.c:70
dynamic_array
Definition:
dynamic_array.h:7
data_structures
dynamic_array
dynamic_array.h
Generated by
1.8.20