数据结构-队列
2018-06-12 本文已影响0人
豆瓣奶茶

我们之前用浏览器历史记录作为了栈的例子。
同样,我们经常用的键盘的输入缓冲区就是按队列的形式输入输出的。
队列的链式存储结构


队列的创建

队列的插入

队列的顺序存储结构

我们考虑对头的元素出去后,我们后面的元素都不移动,只把对头的指针进行移动。

而循环队列完美的解决了这种假溢出的错误

我们之前用浏览器历史记录作为了栈的例子。
同样,我们经常用的键盘的输入缓冲区就是按队列的形式输入输出的。
我们考虑对头的元素出去后,我们后面的元素都不移动,只把对头的指针进行移动。
而循环队列完美的解决了这种假溢出的错误