#include<bits/stdc++.h>
using namespace std;
int main(){
    deque<int> d;
    d.push_back(3);
    d.push_back(4);
    d.push_front(2);
    d.push_front(1);
    for(int i=0;i<d.size();i++){
        cout<<d[i]<<" ";
    }
    cout<<"\n";
    d.pop_back();
    for(int i=0;i<d.size();i++){
        cout<<d[i]<<" ";
    }
    cout<<"\n";
    d.pop_front();
    for(int i=0;i<d.size();i++){
        cout<<d[i]<<" ";
    }
    cout<<"\n";
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: