Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <queue>
- #include <string>
- #include <iostream>
- #include <sstream>
- using namespace std;
- class MyType{
- // этот класс можно оставить пустым
- };
- template <typename T> class Queue {
- public:
- // конструктор
- Queue() {
- current = 0;
- first = 0;
- }
- ~Queue() = default;
- void push(T elem) {
- array[current++] = elem;
- }
- T front() {
- return array[first];
- }
- void pop() {
- first++;
- }
- bool empty() {
- return current == first;
- }
- private:
- int current, first;
- T array[100000];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement