Skip to content

Commit 9860e6f

Browse files
committed
update
1 parent 1577906 commit 9860e6f

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

src/dataStructure/queue/README.md

+45-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
# 队列结构
1+
# 队列结构
2+
## 准备数据
3+
4+
```java
5+
class DATA{
6+
String name;
7+
int age;
8+
}
9+
10+
/*
11+
* 顺序结构队列
12+
* sequential queue
13+
*/
14+
class SQType{
15+
static final int QUEUELEN = 15;
16+
DATA[] data = new DATA[QUEUELEN]; // 队列顺序结构数组
17+
int head; // 队头
18+
int tail; // 队尾
19+
}
20+
```
21+
22+
在上述代码中,定义了队列结构的最大长度QUEUELEN,队列结构数据元素的类DATA及队列结构的类SQType。在类SQType中,data为数据元素,head为队头的序号,tail为队尾的序号。当head=0时表示队列为空,当tail=QUEUELEN时表示队列已满。
23+
## 初始化队列结构
24+
顺序初始化操作步骤如下:
25+
1. 按符号常量QUEUELEN指定
26+
27+
## 判断空队列
28+
29+
## 判断满队列
30+
31+
## 清空队列
32+
33+
## 释放空间
34+
35+
## 入队列
36+
37+
## 出队列
38+
39+
## 读结点数据
40+
41+
## 计算队列长度
42+
43+
## 队列结构操作实例
44+
队列实例操作源码
45+
[Queue.java](./Queue.java)

0 commit comments

Comments
 (0)