文件名称:queue
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:4.88kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
组队列算法:
设置队列指针a和b,a和b都为0
建立n个数组记录元素的分组情况
初始化,i=0,表示当前有多少个队列已经有元素
读入1个命令
如果是删除命令,从第a个队列开始搜索,找到第1个元素出队
如果删除元素后队列变空,a++
如果是结束命令,输出所有队列的元素,注意队列为空则不要输出
如果是插入命令,首先检查a到b中各个队列是否有同组元素
如果在第k个队列发现同组元素,则进入第k队列
如果无发现,则插入第b个队列,b++
-Group queue algorithm: the establishment of a queue array contains n queues, n = 1000, set the queue is empty for all queue pointers a and b, a and b are 0 records to establish an array of n elements of the group of initialization, i = 0, indicating the current number of queue has elements read a command if it is delete command, from the first a one queue to start the search, to find the first element of a team if you delete elements after the queue is empty, a++ if it is the end of the command , output all the elements of the queue, the queue is empty, do not pay attention to the output if it is inserted command, first check from a to b in each queue have the same group element if the queue is found in the k-th element of the same group, then enter the queue if no k-th found, then insert the first b queues, b++
设置队列指针a和b,a和b都为0
建立n个数组记录元素的分组情况
初始化,i=0,表示当前有多少个队列已经有元素
读入1个命令
如果是删除命令,从第a个队列开始搜索,找到第1个元素出队
如果删除元素后队列变空,a++
如果是结束命令,输出所有队列的元素,注意队列为空则不要输出
如果是插入命令,首先检查a到b中各个队列是否有同组元素
如果在第k个队列发现同组元素,则进入第k队列
如果无发现,则插入第b个队列,b++
-Group queue algorithm: the establishment of a queue array contains n queues, n = 1000, set the queue is empty for all queue pointers a and b, a and b are 0 records to establish an array of n elements of the group of initialization, i = 0, indicating the current number of queue has elements read a command if it is delete command, from the first a one queue to start the search, to find the first element of a team if you delete elements after the queue is empty, a++ if it is the end of the command , output all the elements of the queue, the queue is empty, do not pay attention to the output if it is inserted command, first check from a to b in each queue have the same group element if the queue is found in the k-th element of the same group, then enter the queue if no k-th found, then insert the first b queues, b++
(系统自动生成,下载前可以参看下载内容)
下载文件列表
queue/queue.cpp
queue/queue.dsp
queue/queue.dsw
queue/queue.ncb
queue/queue.opt
queue/说明文档.txt
queue/Debug
queue
queue/queue.dsp
queue/queue.dsw
queue/queue.ncb
queue/queue.opt
queue/说明文档.txt
queue/Debug
queue
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.