-
Notifications
You must be signed in to change notification settings - Fork 0
/
Deque.hpp
44 lines (36 loc) · 877 Bytes
/
Deque.hpp
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
//
// Created by Lenovo on 10/2/2023.
//
#ifndef PP2__NOTATION_CONVERTER__DEQUE_HPP
#define PP2__NOTATION_CONVERTER__DEQUE_HPP
#include <string>
#include <sstream>
#include <algorithm>
#include <stdexcept>
using namespace std;
class Node {
public: string data;
Node * next;
Node * prev;
Node(string data): data(data),
next(nullptr),
prev(nullptr) {}
};
class Deque {
private:
Node* front;
Node* rear;
int size;
public:
Deque();
~Deque();
bool isEmpty() const;
int getSize() const;
void pushFront(const std::string& data);
void pushRear(const std::string& data);
std::string popFront();
std::string popRear();
std::string getFront() const;
std::string getRear() const;
};
#endif //PP2__NOTATION_CONVERTER__DEQUE_HPP