Fix array queue.

This commit is contained in:
Yudong Jin
2023-02-01 03:23:29 +08:00
parent 658ad90377
commit 5eae708035
15 changed files with 425 additions and 365 deletions

View File

@ -75,6 +75,14 @@ func TestArrayQueue(t *testing.T) {
// 判断是否为空
isEmpty := queue.isEmpty()
fmt.Println("队是否为空 =", isEmpty)
/* 测试环形数组 */
for i := 0; i < 10; i++ {
queue.offer(i)
queue.poll()
fmt.Print("第", i, "轮入队 + 出队后 queue =")
PrintSlice(queue.toSlice())
}
}
func TestLinkedListQueue(t *testing.T) {