java实现队列与循环队列

队列
public class Queue {
private int maxSize;
private int front;
private int rear;
private int[] arr;

public Queue(int maxSize) {
this.maxSize = maxSize;
arr = new int[maxSize];
front = -1;
rear = -1;
}

// 判断队列是否满
public boolean isFull() {
return rear == maxSize - 1;
}

// 判断队列是否空
public boolean isEmpty() {
return front == rear;
}

// 入队
public void inQueue(int n) {

java实现队列与循环队列最先出现在Python成神之路

版权声明:
作者:cc
链接:https://www.techfm.club/p/11156.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>