Skip to content

Instantly share code, notes, and snippets.

@limboinf
Created December 24, 2016 14:44
Show Gist options
  • Save limboinf/95818c7ca7cb41da613cdb1de328b6a0 to your computer and use it in GitHub Desktop.
Save limboinf/95818c7ca7cb41da613cdb1de328b6a0 to your computer and use it in GitHub Desktop.
数据结构:队列
/*
* ADT 队列(Queue)
* Data
* 同线性表。元素具有相同的类型,相邻元素具有前驱和后继关系。
* Operation
* InitQueue(*Q) // 初始化, 建立一个空队列
* DestroyQueue(*Q) // 若Q存在则销毁队列
* ClearQueue(*Q) // 将队列Q清空
* QueueEmpty(Q) // 是否为空
* GetHead(Q, *e) // 若队列存在且非空,用e返回队列Q的队头元素
* EnQueue(*Q, e) // 若队列Q存在,插入新元素e到队列Q中并成为队尾元素
* DeQueue(*Q, *e) // 删除队列Q中队头元素,并用e返回其值
* QueueLength(Q) // 返回队列Q的元素个数
* endADT
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment