STL Deque
Doubly Ended Queue (Deque)
Deque using STL
#include <iostream>
#include <queue>
using namespace std;
int main() {
deque<int> de;
de.push_front(444);
de.push_back(555);
cout << de.front() << "\n";
cout << de.back() << "\n";
de.pop_front(); // 444 removed
cout << de.front() << "\n";
cout << de.back() << "\n";
de.pop_front(); // 555 removed
if (de.empty()) {
cout << "Empty Queue!" << "\n";
}
else{
cout << "Queue isn't empty" << "\n";
}
}