Using Linked List || Simple to understand
\nclass FrontMiddleBackQueue {\n\n    LinkedList<Integer> list;\n    \n    public FrontMiddleBackQueue() {\n        list = new LinkedList();\n    }\n    \n    p
```\nclass FrontMiddleBackQueue {\n\n    LinkedList<Integer> list;\n    \n    public FrontMiddleBackQueue() {\n        list = new LinkedList();\n    }\n    \n    public void pushFront(int val) {\n        list.add(0,val);\n    }\n    \n    public void pushMiddle(int val) {\n        list.add(list.size()/2,val);\n    }\n    \n    public void pushBack(int val) {\n        list.add(val);\n    }\n    \n    public int popFront() {\n        if(list.isEmpty()==false)\n            return list.remove(0);\n        return -1;\n    }\n    \n    public int popMiddle() {\n        if(list.isEmpty()==false) {\n            return list.remove((list.size()-1)/2);\n        }\n        return -1;\n    }\n    \n    public int popBack() {\n        if(list.isEmpty()==false)\n            return list.remove(list.size()-1);\n        return -1;\n    }\n}\n\n/**\n * Your FrontMiddleBackQueue object will be instantiated and called as such:\n * FrontMiddleBackQueue obj = new FrontMiddleBackQueue();\n * obj.pushFront(val);\n * obj.pushMiddle(val);\n * obj.pushBack(val);\n * int param_4 = obj.popFront();\n * int param_5 = obj.popMiddle();\n * int param_6 = obj.popBack();\n */\n```
[]