Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <string>
- #include <cstdio>
- #include <iostream>
- using namespace std;
- class Queue {
- public:
- // конструктор
- Queue() {
- curr = 0;
- first = 0;
- }
- ~Queue() = default;
- void push(int elem) {
- arr[curr++] = elem;
- }
- int front() {
- return arr[first];
- }
- void pop() {
- first++;
- }
- bool empty() {
- return curr == first;
- }
- private:
- int curr, first;
- int arr[100000];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement