[C++] Clumsy code using int array[]
\nclass FrontMiddleBackQueue {\npublic:\n    int a[1000];\n    int l;\n    int m;\n    int f;\n    int size;\n    \n    FrontMiddleBackQueue() {\n        l = -1
```\nclass FrontMiddleBackQueue {\npublic:\n    int a[1000];\n    int l;\n    int m;\n    int f;\n    int size;\n    \n    FrontMiddleBackQueue() {\n        l = -1;\n        f = -1;\n        size = 0;\n    }\n    \n    int findMid() {\n        int mid = size / 2;\n        if (size % 2 == 1)\n            mid++;\n        return mid;\n    }\n    \n    bool isEmpty() {\n        return f == -1;\n    }\n    \n    void display() {\n        // for (int i = 0; i < size; i++) {\n        //     cout << a[i] << " ";\n        // }\n        // cout << "\\n";\n    }\n    \n    void pushFront(int val) {\n        if (isEmpty()) {\n            f = 0;\n            l = 0;\n        }\n        else {\n            f++;\n        }\n        a[f] = val;\n        size++;\n        display();\n    }\n    \n    void pushMiddle(int val) {\n        m = findMid(); \n        if (isEmpty()) {\n            f = 0;\n            m = 0;\n            l = 0;\n        }\n        else {\n            for (int i = size - 1; i >= m; i--) {\n                a[i + 1] = a[i];\n            }\n            f++;\n        }\n        a[m] = val;\n        size++;\n        display();\n    }\n    \n    void pushBack(int val) {\n        if (isEmpty()) {\n            f = 0;\n            l = 0;\n        }\n        else {\n            for (int i = size - 1; i >= 0; i--) {\n                a[i + 1] = a[i]; \n            }\n            f++;\n        }\n        a[l] = val;\n        size++;\n        display();\n    }\n    \n    int popFront() {\n        if (isEmpty()) {\n            return -1;\n        }\n        int val = a[f];\n        f--;\n        size--;\n        display();\n        return val;\n    }\n    \n    int popMiddle() {\n        if (isEmpty()) {\n            return -1;\n        }\n        m = size / 2;\n        int val = a[m];\n        for (int i = m; i < size - 1; i++) {\n            a[i] = a[i + 1];\n        }\n        f--;\n        size--;\n        display();\n        return val;\n    }\n    \n    int popBack() {\n        if (isEmpty()) {\n            return -1;\n        }\n        int val = a[l];\n        for (int i = 0; i < size - 1; i++) {\n            a[i] = a[i + 1];\n        }\n        f--;\n        size--;\n        display();\n        return val;\n    }\n};\n\n```
['Array', 'C', 'C++']