Linked-List👌 || Easy✅ to Understand Solution⭐ using Java☕
PLEASE UPVOTE IF  YOU LIKED THE SOLUTION IT REALLY HELPS A LOT!!\n*\n\nclass FrontMiddleBackQueue {\n    LinkedList<Integer> list;\n    public FrontMiddleBackQu
**PLEASE UPVOTE IF  YOU LIKED THE SOLUTION IT REALLY HELPS A LOT!!**\n****\n```\nclass FrontMiddleBackQueue {\n    LinkedList<Integer> list;\n    public FrontMiddleBackQueue() {\n        // initialize it\n        list = new LinkedList<>();\n    }\n\n    public void pushFront(int val) {\n        // add at the 0th index or at Head\n        list.add(0, val);\n    }\n\n    public void pushMiddle(int val) {\n        // push at the middle index\n        list.add(list.size() / 2, val);\n    }\n\n    public void pushBack(int val) {\n        // add at tail\n        list.add(val);\n    }\n\n    public int popFront() {\n        if (list.isEmpty()) {\n            return -1;\n        }\n        // use removeFirst\n        return list.removeFirst();\n    }\n\n    public int popMiddle() {\n        if (list.isEmpty()) {\n            return -1;\n        }\n        // remove the element at the mid index\n        return list.remove(findMid());\n    }\n\n    public int popBack() {\n        if (list.isEmpty()) {\n            return -1;\n        }\n         // use removeLast\n        return list.removeLast();\n    }\n\n    public int findMid() {\n        // give the middle index \n        return (list.size() - 1) / 2;\n    }\n\t// Don\'t FORGET TO UPVOTE , THANKS\n}\n```\n****\n# upvote\n# java
['Linked List', 'Queue', 'Java']