class MyCircularQueue {
private int front;
private int rear;
private int[] elem;
private int usedSize;
private int DEFAULT_CAPACITY;//总共大小
/** Initialize your data structure here. Set the size of the queue to be k. */
public MyCircularQueue(int k) {
this.elem = new int[k+1];
DEFAULT_CAPACITY = k+1;
this.front = 0;
this.rear = 0;
}
/** Insert an element into the circular queue. Return true if the operation is successful. */
public boolean enQueue(int value) {
if(isFull()) {
return false;
}
this.elem[this.rear] = value;
this.rear = (this.rear+1)