摘要
顺序队列是一种重要的线性表,它采用数组进行存储数据。为了避免出现假溢出,可把数组设计成逻辑上首尾相连的循环队列。在循环队列的应用中非常重要的一项操作即判队空或队满,目前较为常用的有设置一个标志位和牺牲一个数组空间来进行判定。该文提出设置两个标志位的新方法进行判定,并给出了相应的入队和出队算法。
Order queue is an important linear list,it uses an array to store data.In order to avoid fake overflow,the array can be logically designed to the circular queue which is end to end.An important operation in the application of the circular queue is to judge whether circular queue is empty or full,now more common of which are setting up a flag and sacrificing the space of an array to judge.The paper proposed a new mothod to set up two flags to judge and gave the algorithms for enqueue and dequeue.
出处
《电脑知识与技术(过刊)》
2011年第5X期3464-3465,共2页
Computer Knowledge and Technology
关键词
队列
数组
入队
出队
queue
array
enqueue
dequeue