📄 queue.java
字号:
/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2005</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class Queue { private class QueueNode { public int data; public QueueNode link; } public QueueNode front; public QueueNode rear; public Queue() { front=null; rear=null; } public boolean isEmpty() { return (front==null); } public void ENQUEUE(int ne) { QueueNode newNode=new QueueNode(); newNode.data=ne; newNode.link=null; if (front==null) { front=newNode; rear=newNode; } else { rear.link=newNode; rear=rear.link; } } public int DEQUEUE() { if(isEmpty()) { return -1; } int temp=front.data; front=front.link; if(front==null) { rear=null; } return temp; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -