[faster then 100%][easy understanding][c++]
\nclass FrontMiddleBackQueue {\npublic:\n\n    vector<int> queue;\n\t\n    FrontMiddleBackQueue(){\n\t}\n    \n    void pushFront(int val){\n        queue.inser
```\nclass FrontMiddleBackQueue {\npublic:\n\n    vector<int> queue;\n\t\n    FrontMiddleBackQueue(){\n\t}\n    \n    void pushFront(int val){\n        queue.insert(queue.begin(),val);\n    }\n    \n    void pushMiddle(int val){\n        int middle;\n        middle = queue.size()/2;\n        queue.insert(queue.begin()+middle,val);\n    }\n    \n    void pushBack(int val){\n        queue.push_back(val);\n    }\n    \n    int popFront(){\n        if(queue.size() == 0)\n            return -1;\n        \n        int val = queue[0];\n        queue.erase(queue.begin());\n        return val;\n    }\n    \n    int popMiddle(){\n        if(queue.size() == 0)\n            return -1;\n        \n\t\tint middle= (queue.size()%2 == 0) ? (queue.size()/2)-1 : queue.size()/2;\n        \n\t\tint val = queue[middle];\n        queue.erase(queue.begin()+middle);\n        return val;\n    }\n    \n    int popBack(){\n        if(queue.size() == 0)\n            return -1;\n        \n        int val = queue.back();\n        queue.pop_back();\n        return val;\n    }\n    \n};\n```\n**Feel free to ask any question in the comment section.**\nI hope that you\'ve found the solution useful.\nIn that case, **please do upvote and encourage me** to on my quest to document all leetcode problems\uD83D\uDE03\nHappy Coding :)\n
['C', 'C++']