-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeque.h
More file actions
35 lines (31 loc) · 659 Bytes
/
Copy pathDeque.h
File metadata and controls
35 lines (31 loc) · 659 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
#ifndef DEQUE_H
#define DEQUE_H
#include <iostream>
#include <cassert>
#define edl '\n'
template <class type>
class Deque
{
int size{};
int front{};
int rear{};
int added_elements{};
type *array{};
int next(int pos);
int prev(int pos);
public:
Deque(int size);
~Deque();
// Prevent copying (Rule of Three)
Deque(const Deque&) = delete;
Deque& operator=(const Deque&) = delete;
int get_size() const;
void enqueue_rear(type val);
void enqueue_front(type val);
type dequeue_front();
type dequeue_rear();
bool is_empty() const;
bool is_full() const;
void print() const;
};
#endif