public void enque(int data) {
        if (isFull()) {
            System.out.println("full queue");
            return;
        }
        if (cursor < 0) {
            elements[++cursor] = data;
        } else {
            int temp = cursor++;
            while (temp >= 0) {
                if (data > elements[temp]) {
                    elements[temp + 1] = elements[temp--];
                } else {
                    break;
                }
            }
            elements[temp + 1] = data;
        }
    }