forked from blhair/data_structure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.h
More file actions
37 lines (26 loc) · 780 Bytes
/
func.h
File metadata and controls
37 lines (26 loc) · 780 Bytes
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
#ifndef FUNC_H
#define FUNC_H
typedef struct List{
int element;
struct List *next;
}LIST;
typedef struct double_ended_list{
int element;
struct double_ended_list *prev;
struct double_ended_list *next;
}DELIST;
LIST *initList();
void insert(LIST *l, int element);
//insert at the head of the list
int deleteList(LIST *l, int index);
//delete the element at the given index
int isEmpty(LIST *l);
//check if the list is empty:0 for empty, 1 for not empty
DELIST *initDEList();
void insertDE(DELIST *l, int element);
//insert at the head of the list
void deleteDE(DELIST *l, int index);
//delete the element at the given index
int isEmptyDE(DELIST *l);
//check if the list is empty:0 for empty, 1 for not empty
#endif