搜索资源列表
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
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个元素出队 状态
CS2208_DSLab_Programs
- CS2208 - Data Structures Lab (Anna University) EXERCISES 1a. Implement singly linked lists. 1b. Implement doubly linked lists. 2. Represent a polynomial as a linked list and write functions for polynomial addition. 3. Implement stack and
Static
- (1)采用链式存储实现栈的初始化、入栈、出栈操作。 (2)采用顺序存储实现栈的初始化、入栈、出栈操作。 (3)采用链式存储实现队列的初始化、入队、出队操作。 (4)采用顺序存储实现循环队列的初始化、入队、出队操作。 (5)在主函数中设计一个简单的菜单,分别测试上述算法。-(1) initialization chain store stack, the stack, the stack operation. (2) stored in order to achieve the i
dek
- A double-ended queue (dequeue).
queue
- 用单链表形式实现队列的结构。定义基本操作:入队,出队,打印所有队列元素。-The form of a single linked list, queue structure. Define the basic operations: enqueue, dequeue Print all queue elements.
GMGridView
- ios上的列表库,GMGridView,可以横向总想滚动列表,拖动、删除、编辑单元格等-An iOS Grid-View allowing the user to sort the views in the scrollView and also to see the views in full-size by pinching them. This view is inspired by the UITableView and uses a datasource and delegates i
The-circular-list-Josephus-problem
- 循环链表josephus问题。设有n个人围圈,现从第s个人开始报数,数到第m个人出列,然后从出列的下一个人从新开始报数,数到第m个人又出列,如此反复,直到所有人出列-Circular list josephus problem. Suppose there are n individuals in a circle, is from the first s individual reported the number of individuals out to the m-number colu
4
- 通过扩展已实现的基本数据结构,模拟更为复杂的数据结构,是一种常见而实用的技巧。这里,我们将利用栈结构,来模拟一种功能增强的队列。 具体来说,你必须首先实现一个元素类型为int的栈,该栈能且只能支持以下操作接口: bool empty() //判断是否栈空 void push(int) //向栈中压入一个整数 int pop() //弹出栈顶元素,并返回其数值 int top() //仅获取栈顶元素的值,但不弹出 接下来,你必须借助以上栈结构,
