C Project Template
Loading...
Searching...
No Matches
src
utils.h
Go to the documentation of this file.
1
11
#ifndef UTILS_H
12
#define UTILS_H
13
#define EMTY_QUE_SIG -121242
14
#define N_ASCII_ELEMENT 128
15
#define MAX_STR_LEN 150000
16
17
#include <stdlib.h>
18
#include <assert.h>
19
20
int
str2ascii(
char
);
21
29
int
argmax
(
int
a,
int
b);
30
31
32
33
//dynamic array
34
typedef
struct
{
35
int
len;
36
int
size;
37
int
* i;
38
}
dymArr
;
39
40
//init and kill
41
dymArr
init_Arr(
int
size);
42
void
kill_dymArr(
dymArr
*);
43
44
//clear
45
void
clear_Arr(
dymArr
*);
46
47
//append
48
void
append_dymArr(
dymArr
*,
int
val);
49
int
get_item(
dymArr
,
int
i);
50
int
pop_item(
dymArr
*);
51
52
53
typedef
struct
{
54
dymArr
arr;
55
int
head;
56
int
tail;
57
}
que
;
58
59
que
init_que(
int
size);
60
void
kill_que(
que
*);
61
62
void
enque(
que
*,
int
val);
63
int
deque(
que
*);
64
int
deque_rear(
que
*);
65
int
peek_que(
que
*);
66
int
peek_que_rear(
que
* q);
67
68
#endif
dymArr
Definition
utils.h:34
que
Definition
utils.h:53
argmax
int argmax(int a, int b)
Argmax function with intergers.
Definition
utils.c:8
Generated by
1.10.0