-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdequeue.h
More file actions
52 lines (41 loc) · 1.5 KB
/
dequeue.h
File metadata and controls
52 lines (41 loc) · 1.5 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
/*
* ---- The Unbalanced Tree Search (UTS) Benchmark ----
*
* Copyright (c) 2010 See AUTHORS file for copyright holders
*
* This file is part of the unbalanced tree search benchmark. This
* project is licensed under the MIT Open Source license. See the LICENSE
* file for copyright and licensing information.
*
* UTS is a collaborative project between researchers at the University of
* Maryland, the University of North Carolina at Chapel Hill, and the Ohio
* State University. See AUTHORS file for more information.
*
*/
#ifndef DEQUEUE_H
#define DEQUEUE_H
#include "dlist.h"
struct dequeue{
dlist head;
dlist tail;
};
typedef struct dequeue *dequeue;
/* create an empty dqueue */
extern dequeue deq_create();
/* insert an element at the front of the dqueue */
extern void deq_pushFront(dequeue q, void *element);
/* insert an element at the back of the dqueue */
extern void deq_pushBack(dequeue q, void *element);
/* delete an element from the front of the dqueue and return it */
extern void *deq_popFront(dequeue q);
/* delete an element from the back of the dqueue and return it */
extern void *deq_popBack(dequeue q);
/* return a true value if and only if the dqueue is empty */
extern int deq_isEmpty(dequeue q);
/*get the front without removing it from the dequeue*/
extern void* deq_peekFront(dequeue q);
/*get teh back without removing it from the dequeue*/
extern void* deq_peekBack(dequeue q);
extern void deq_mkEmpty(dequeue q);
extern int deq_length(dequeue q);
#endif