-
2.2
已知线性表中的元素以值递增有序排列,并以单链表作存储结构。试写一高效的算法,删除表中所有值大于mink且小于maxk的元素(若表中存在这样的元素)同时释放被删结点空间,并分析你的算法的时间复杂度(注意:mink和maxk是给定的两个参变量,它们的值可以和表中的元素相同,也可以不同)。(Known linear elements in the table to the value increments ordered, and a single list for the storage structure. Try to write a highly efficient algorithm to delete all values greater than mink and maxk elements smaller than (if there is such an element in the table) while the release of the deleted node space, and analyze your time complexity of the algorithm (Note: mink and maxk is given two parameters variables, their values and elements in the table can be the same or different).)
- 2015-04-11 23:11:41下载
- 积分:1
-
BeiDa_ACM1702
北大ACM1702题 转换为3进制
很经典(NULL)
- 2009-12-08 11:31:40下载
- 积分:1
-
pinfanfangwen
设有一头指针为L的带有表头结点的非循环双向链表,其每个结点中除有prev(前驱指针),data(数据)和next(后继指针)域外,还有一个访问频度域freq。在链表被起用前,其值均初始化为零。每当在链表中进行一次Locate(L,x)运算时,令元素值为x的结点中freq域的值增1,并使此链表中结点保持按访问频度非增(递减)的顺序排列,同时最近访问的结点排在频度相同的结点的最后,以便使频繁访问的结点总是靠近表头。试编写符合上述要求的Locate(L,x)运算的算法,该运算为函数过程,返回找到结点的地址,类型为指针型。(Has a head pointer is non-circular doubly linked list L with a header node, each node in addition to prev (precursor pointer), data (data) and next (successor pointers) outside, there is an access frequency degree domain freq. Before the list was hired, their values are initialized to zero. Whenever carried out in the list once Locate (L, x) when the operation, so that the element node x is the value in freq domain by one, and keep this list in the node-access frequency of non-increasing (decreasing) the order, while a recent visit to the nodes in the same row of the frequency of the last node, so that the nodes are frequently accessed tables are always near the head. Locate (L, x) algorithm is prepared in accordance with the above requirements of the test operation, the operation as a function of the process, return to find the address of the node of type pointer.)
- 2015-01-15 22:31:59下载
- 积分:1
-
Data-structure-diagram
数据结构中图的存储结构的建立与搜索
建立图的二种存储结构
在不同的结构上实现遍历
(Data structure diagram of the storage structure of the establishment of the search to establish two kinds of graph storage structure in the different structures to achieve through)
- 2011-06-27 09:29:40下载
- 积分:1
-
suanfa
自己编写的floyd 最短距离求解程序。实用简单。gcc
(Floyd shortest distance to write your own solver. Practical and simple. gcc)
- 2012-09-02 14:59:02下载
- 积分:1
-
xiaobaishu
参加数学建模的同学很可能会遇到这套题。本程序采用链表进行编写,很方便地解决了小白鼠问题。(Mathematical modeling of the students participating are likely to encounter this question, the program uses the list to solve the problem of mice, very convenient.)
- 2013-08-29 16:09:43下载
- 积分:1
-
polynomial
说明: 线性表的基本运算及多项式的算术运算在顺序表泪SeqList 中增加成员函数void Reverse()实现顺序表的逆置
(Linear form the basic arithmetic operations and the polynomial form in order to increase tear SeqList member function void Reverse () to achieve the inverse order of the table set)
- 2010-04-20 20:11:40下载
- 积分:1
-
44
说明: 给定程序中,函数fun的功能是:将a所指3×5矩阵中第k列的元素左移到第0列,第k列以后的每列元素依次左移,原来左边的各列依次绕道右边。
例如,有以下矩阵:
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
若k结果为2,程序执行结果为:
3 4 5 1 2
3 4 5 1 2
3 4 5 1 2
请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。
注意:源文件存放在考生文件夹下的BLANK1.C中
不得增行或删行,也不得更改程序的结构!
(A given program, function fun feature is: a 3 × 5 matrix referred to in the first k elements of the left column to move Section 0, the k elements of each column after column followed by the left, the original columns in the left turn Bypass on the right. For example, the following matrix: 123,451,234,512,345 If k is 2, the program execution results: 345,123,451,234,512 in the program underscore the right content at the fill and to remove the underscore, so that the program reach the right result. Note: The source files in the folder of BLANK1.C candidates are not allowed by the line or delete line, nor change the structure of the program!)
- 2011-08-11 07:53:10下载
- 积分:1
-
abc
数据结构的稀疏矩阵的几部分操作,广工的课程设计(Sparse matrix operations)
- 2013-12-03 15:57:53下载
- 积分:1
-
code
c语言的一些小李子,初学c的朋友有帮助,主要有顺序表、二分查找、二叉树、单链表等等(Some Survival Song c language, c beginner to help a friend, there are sequence tables, binary search, binary tree, a single linked list, etc.)
- 2011-08-11 20:50:26下载
- 积分:1