C Project Template
Loading...
Searching...
No Matches
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
20int str2ascii(char);
21
29int argmax(int a, int b);
30
31
32
33//dynamic array
34typedef struct{
35 int len;
36 int size;
37 int* i;
38} dymArr;
39
40//init and kill
41dymArr init_Arr(int size);
42void kill_dymArr(dymArr*);
43
44//clear
45void clear_Arr(dymArr*);
46
47//append
48void append_dymArr(dymArr*, int val);
49int get_item(dymArr, int i);
50int pop_item(dymArr*);
51
52
53typedef struct{
54 dymArr arr;
55 int head;
56 int tail;
57} que;
58
59que init_que(int size);
60void kill_que(que*);
61
62void enque(que*, int val);
63int deque(que*);
64int deque_rear(que*);
65int peek_que(que*);
66int peek_que_rear(que* q);
67
68#endif
Definition utils.h:34
Definition utils.h:53
int argmax(int a, int b)
Argmax function with intergers.
Definition utils.c:8