-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue_from_stacks.h
More file actions
33 lines (27 loc) · 1006 Bytes
/
Copy pathqueue_from_stacks.h
File metadata and controls
33 lines (27 loc) · 1006 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
/*
* This file contains the definitions of structures and prototpyes of functions
* you'll implement to create a queue using two stacks.
*/
#ifndef __QUEUE_FROM_STACKS_H
#define __QUEUE_FROM_STACKS_H
#include "stack.h"
/*
* This is the definition of the structure you'll use to implement a queue
* using two stacks.
*/
struct queue_from_stacks {
struct stack* s1;
struct stack* s2;
};
/*
* These are the prototypes of the functions you'll write in
* queue_from_stacks.c to implement a queue from two stacks. See the
* documentation in queue_from_stacks.c for more details about each function.
*/
struct queue_from_stacks* queue_from_stacks_create();
void queue_from_stacks_free(struct queue_from_stacks* queue);
int queue_from_stacks_isempty(struct queue_from_stacks* queue);
void queue_from_stacks_enqueue(struct queue_from_stacks* queue, int value);
int queue_from_stacks_front(struct queue_from_stacks* queue);
int queue_from_stacks_dequeue(struct queue_from_stacks* queue);
#endif