搜索资源列表
main
- 约瑟夫斯(Josephus)问题的一种描述是:编号为1,2,…,n的n个人按顺时针方向围坐一圈,每人持有一个密码(正整数)。一开始任选一个正整数作为报数上限值m,从第一个人开始按顺时针方向自1开始报数,报到m时停止报数。报m的人出列,将他的密码作为新的m值,从他在顺时针方向下一个人开始重新从1报数,如此下去,直至所有的人全部出列为止。试设计一个程序,按出列顺序印出各人编号。-Josephus (Josephus) a descr iption of the problem: the numb
JoyDe
- 利用书中图5.19和图5.20的最大值堆实现一个优先队列。对于队列的操作应该支持下列几种指令: void enqueue[int ObjectID, int Priority] int dequeue[] void changeweight[int ObjectID, int newPriority] 函数enqueue向优先队列中插入一个ID号为ObjectID、优先级为Priority的新对象。函数dequeue从优先队列中删除优先级最高的对象,并返回该对象的
218
- 大顶堆实现一个优先队列。对于队列的操作应该至少支持下列几种指令: Void enqueue[int ObjectID, int Priority] Int dequeue[] Void changeweight[int ObjectID, int newPriority] -Large Top Heap realize a priority queue. For the operation of the queue should be at least support
Link-Queue
- 链式队列的存储结构以及功能实现,有QueueTraverse(),EnQueue(),DeQueue()等子函数。-Queue chain structure and function of the realization of storage, there are QueueTraverse (), EnQueue (), DeQueue () Function, etc..
my_BFS
- 1. Enqueue the root node. 2. Dequeue a node and examine it. * If the element sought is found in this node, quit the search and return a result. * Otherwise enqueue any successors (the direct child nodes) that have not yet been discovered.
queue
- Stack and Queue Enqueue Deq-Stack and Queue Enqueue Dequeue
StackandQueueDequeue
- Stack and Queue Deq-Stack and Queue Dequeue
queue
- 用双头栈模拟队列,要求实现一个队列,提供Enqueue(&q, e)和Dequeue(&q, &e)两个接口 保证先进先出,用双头栈DStack实现(分A、B两个头),DStack只提供pushA(), popA(), pushB(), popB()等几个接口,不能访问任何位置i的元素,不能进行任意位置的插入、删除操作-Queue with a double stack simulation, called for a queue to provide Enqueue (& q, e) an
queue
- 数据结构中,基于队列的操作,包括判断队列是否为空,入队,出队等操作-Data structures, queue-based operations, including to determine whether the queue is empty, enqueue, dequeue and other operations
priorityQueue
- 利用二叉树实现的优先级队列类,包含了基本的入队,出队操作,减小键值等功能,可作为数据结构学习之用。-The priority queue class is implemented using binary tree. The fundamental function includes enqueue, dequeue, decrease key, etc.
FIFO
- 队列是一个先进先出的数据结构,支持业务enque(添加一个项目的结构)和dequeue(删除一个项目从结构)。作为一个FIFO数据结构,项目将在相同的顺序,他们原本排队出列。-A queue is a FIFO data structure that supports the operations enque (to add an item to the structure) and dequeue (to remove an item from the structure). As a FIF
duilie
- 可以输出队列中的当前元素,还可以对队列判空,进行入队和出队-Can output the current element in the queue, can also be sentenced to empty the queue, enqueue and dequeue
fifo_success
- 实现的是FIFO(队列)的创建、销毁。入队、出队等相关操作。仅供参考-Achieve is the creation of the FIFO (queue), destroyed. Enqueue and dequeue operations. For reference only
dequeue
- Write a C program to implement a double ended queue ie dequeue using doubly linked list. Implement all the operations of deq-Write a C program to implement a double ended queue ie dequeue using doubly linked list. Implement all the operations of deq
ex_2_2
- 链队列的进队和出队算法,删除,添加,队满和队空的描述方法。-Chain into the queue and dequeue algorithm, delete, add, teams and team full of empty descr iption method.
3
- 实现队列运算程序(队列的运用)程序结构: 类型说明; Clearqueue(q)、Emptyqueue(q)、Enqueue(q)、Dequeue(q); main() -Implement queue operations procedures (application queue) program structure:A descr iption of the type
JosephRing
- 输入格式: 第一行两个数据n m ;n表示有多少个人,m是最开始的m值 之后的n行,每行 两个数据:a b 分别表示第a个人的密码; 输出格式: 一行出队的序列;-Input format: a first line and two data nm n represents the number of individuals, m n-th row of the m-value after the beginning of the two data of each line:
33
- 1、设单链表中存放着n个字符,设计算法,判断该字符串中是否有中心对称关系。例如:xyzzyx、xyzyx都算是中心对称的字符串。 2、设计算法判断一个算术表达式的圆括号是否配对。(提示:对表达式进行扫描,遇‘(’进栈,遇‘)’退掉栈顶的‘(’,表达式被扫描完毕,栈为空) 3、假设以带头结点的循环链表表示队列,并只设一个指针指向队尾,编写相应的置队空、入队和出队算法。 -Set single linked list storage n characters, design algori
fk
- 1.分别写出下列函数的递归算法和迭代算法,并求出n=10时的函数值。 Fib(n)= n 当n=0或n=1 Fib(n-2)+Fib(n-1) 当n³ 2 2. 假设以带头结点的循环链表表示队列,并且只设一个指针指向队尾元素结点而不设头指针,试编写相应的队列初始化、入队列、出队列和判断队列状态的算法。 利用上述算法完成下面的各操作,并在每一操作后输出队列状态。 1)下列元素逐一入队:5,7,3,8,55 状态:5个元素 2)3个元素出队 状态
digui
- 队列基本操作算法,包括入队、出队等相关操作-Queue basic operation algorithms, including enqueue and dequeue operations
