C++ Solution || Using Deque || Short & Simple
Code:\n\n\nclass FrontMiddleBackQueue\n{\npublic:\n    deque<int> dq;\n    FrontMiddleBackQueue()\n    {\n    }\n\n    void pushFront(int val)\n    {\n        d
**Code:**\n\n```\nclass FrontMiddleBackQueue\n{\npublic:\n    deque<int> dq;\n    FrontMiddleBackQueue()\n    {\n    }\n\n    void pushFront(int val)\n    {\n        dq.push_front(val);\n    }\n\n    void pushMiddle(int val)\n    {\n        int m = dq.size() / 2;\n        auto it = dq.begin();\n        it = it + m;\n        dq.insert(it, val);\n    }\n\n    void pushBack(int val)\n    {\n        dq.push_back(val);\n    }\n\n    int popFront()\n    {\n        if (dq.empty())\n        {\n            return -1;\n        }\n        int k = dq.front();\n        dq.pop_front();\n        return k;\n    }\n\n    int popMiddle()\n    {\n        if (dq.empty())\n        {\n            return -1;\n        }\n        int m = dq.size() / 2;\n        if (dq.size() % 2 == 0)\n        {\n            m--;\n        }\n        auto it = dq.begin();\n        it = it + m;\n        int k = *it;\n        dq.erase(it);\n        return k;\n    }\n\n    int popBack()\n    {\n        if (dq.empty())\n        {\n            return -1;\n        }\n        int k = dq.back();\n        dq.pop_back();\n        return k;\n    }\n};\n```
['Queue', 'C', 'C++']