@Override
    public int calculateOperations() {
        ArrayList<Integer> calc = this.copyArray();
        int num = 1;
        Boolean sorted = false;
        while (!sorted) {
            sorted = true;
            for (int i = 1; i < calc.size(); i += 2) {
                num++;
                if (calc.get(i) < calc.get(i - 1)) {
                    num += 2;
                    Collections.swap(calc, i, i - 1);
                    sorted = false;
                }
            }
            for (int i = 2; i < calc.size(); i += 2) {
                num++;
                if (calc.get(i) < calc.get(i - 1)) {
                    num += 2;
                    Collections.swap(calc, i, i - 1);
                    sorted = false;
                }
            }
        }
        return num;
    }