Solution with Vector in C++
\'\'\'class FrontMiddleBackQueue {\npublic:\n    vector vals;\n    FrontMiddleBackQueue() {\n        \n    }\n    \n    void pushFront(int val) {\n        vals.
\'\'\'class FrontMiddleBackQueue {\npublic:\n    vector<int> vals;\n    FrontMiddleBackQueue() {\n        \n    }\n    \n    void pushFront(int val) {\n        vals.insert(vals.begin(), val);\n    }\n    \n    void pushMiddle(int val) {\n        int n=vals.size();\n        vals.insert(vals.begin()+ n/2, val);\n    }\n    \n    void pushBack(int val) {\n        vals.push_back(val);\n    }\n    \n    int popFront() {\n        if(vals.size()==0)\n            return -1;\n        int x= vals[0];\n        vals.erase(vals.begin());\n        return x;\n    }\n    \n    int popMiddle() {\n        if(vals.size()==0)\n            return -1;\n        int n=(vals.size()-1)/2;\n        int x=vals[n];\n        vals.erase(vals.begin()+n);\n        return x;\n    }\n    \n    int popBack() {\n        if(vals.size()==0)\n            return -1;\n        int n=vals.size();\n        int x=vals[n-1];\n        vals.pop_back();\n        return x;\n    }\n};\'\'\'
['Queue']