搜索资源列表
递归算法快速排序
- 分而治之方法还可以用于实现另一种完全不同的排序方法,这种排序法称为快速排序(quick sort)。在这种方法中, n 个元素被分成三段(组):左段l e f t,右段r i g h t和中段m i d d l e。中段仅包含一个元素。左段中各元素都小于等于中段元素,右段中各元素都大于等于中段元素。因此l e f t和r i g h t中的元素可以独立排序,并且不必对l e f t和r i g h t的排序结果进行合并。m i d d l e中的元素被称为支点( p i v o t )。图1 4
SortedSet
- 本程序用VC++完成 定义类模板SortedSet (包括方法的实现) ,即元素有序的集合,集合元素的类型和集合元素的最大个数可由使用者确定。要 求该类模板对外提供以下三种操作: insert:加入一个新的元素到合适的位置上,并保证集合元素的值不重复; get:返回比给定值大的最小元素的地址。若不存在,返回-1; del:删除与给定值相等的那个元素,并保持剩余元素的有序性。-the completion of procedures with VC SortedSet clas
newprogram
- 列主元法解方程组C语言代码与LU分解求线性方程 -main-element equations method of C language code and the LU decomposition of linear equations
dan_lian_biao
- 链式存储结构及应用 1.键盘输入一组元素,尾部插入法建立一个单向链表。 2.在单向链表中删除一个结点。 3.在链表中插入一个元素。 -Structure and application of a chain store. Keyboard input of a group of elements, the end of a one-way linked list insertion method. 2. In the one-way to remove a node lis
changesort
- 交换法比较简单,在一组数据中每次用当前的元素同后面的元素比较并在符合条件时交换。直到该组数据是从小到大的序列-Exchange method is relatively simple, in one set of data in each element with the current elements in comparison with the back and in line with the conditions of the exchange. Until the data are
collectioncaculator
- 运用顺序表的基本运算。(插入、删除) 1)集合的数据类型为一个结构体,其中包括一个数组用来存放集合元素,一个整型数据来统计集合元素的个数。生成两个集合A和B。 2)将集合中的元素按照从小到大排序。具体方法为:从第二个元素起(i),依次扫描每个元素前面的所有元素(j),若i<j,则将j插在i的前面,结束对i的排序,照这个方法,再依次对i后的元素进行排序。 3)求两集合的并:生成一个新集合C,将集合A的元素复制过来,对集合B的元素依次进行扫描,若没有该元素,则插入,若已存在,则扫描
shiyanliu
- 假设有一个数据类型为整型的一维数组A,A 中的数据元素呈无序状态,编写一个采用堆排序法将A中的数据元素按由小到大进行排序的程序。-Suppose a data type for the integer one-dimensional array A, A in the data element was disorder, to write a heap sort method used in the data elements A sort of process by small to larg
dui
- 堆排序:用堆排序的方法对记录排序,初始化堆 ,整理堆 ,输出堆顶元素,并将最后一个元素放到堆顶位置,重新建堆。-Heap sort: The sort of method heap sort records, initialize heap, Heap, the top element of the output heap and stack the last element into the top position, re-built reactor.
data_struct5
- 数据结构课后设计题第五章 5.23② 三元组表的一种变型是,从三元组表中去掉 行下标域得到二元组表,另设一个行起始向量,其每 个分量是二元组表的一个下标值,指示该行中第一个 非零元素在二元组表中的起始位置。试编写一个算法, 由矩阵元素的下标值i,j求矩阵元素。试讨论这种方 法和三元组表相比有什么优缺点。-After-school design of data structure problems Chapter 5.23 ② triple a variant of
6
- 对10个数进行排序 1.程序分析:可以利用选择法,即从后9个比较过程中,选择一个最小的与第一个元素交换,下次类推,即用第二个元素与后8个进行比较,并进行交换。 -Sort of number 10 1. Program analysis: selection method can be used, from 9 months after the comparison process, select one of the least exchange with the first ele
queue
- (一)题目: 假设以带头结点的循环链表表示队列,并且只设一个指针指向队尾元素结点而不设头指针,试编写相应的队列初始化、入队列、出队列和判断队列状态的算法。 利用上述算法完成下面的各操作,并在每一操作后输出队列状态。 1)下列元素逐一入队:5,7,3,8,55 状态:5个元素 2) 3个元素出队 状态:2个元素 3)再2个元素出队 状态:队空 4)再1个元素出队 状态:队空(指示下溢) -(A) Title: Suppose to take the l
erfenfa
- 编写程序对数据序列采用二分查找法和顺序查找法查找元素的下标,要求使用类模板实现(其中二分法查找算法要求用递归实现,给定数据序列有序)-Programming data sequence using binary search and sequential search method to find the next element standard, requires the use of class templates (which use a recursive binary search
finding
- 折半查找的算法思想是将数列按有序化(递增或递减)排列,查找过程中采用跳跃式方式查找,即先以有序数列的中点位置为比较对象,如果要找的元素值小于该中点元素,则将待查序列缩小为左半部分,否则为右半部分。通过一次比较,将查找区间缩小一半。 折半查找是一种高效的查找方法。它可以明显减少比较次数,提高查找效率。但是,折半查找的先决条件是查找表中的数据元素必须有序。 -Binary search algorithm idea is to sequence by ordering (ascending or
erfenchashu
- 编写程序对数据序列采用二分查找法和顺序查找法查找元素的下标,要求使用类模板实现(其中二分法查找算法要求用递归实现,给定数据序列有序)。-The data series used to program the binary search method and the sequential search method to find the next element standard, requires the use of class templates (which use a recursiv
9-1
- 1、利用尾插法创建两个类型为字符型的带头结点的有序单链表La和Lb。 2、将La和Lb合并到一新链表Lc中,使得Lc表中元素值也有序,统计Lc中元素个数并显示出来。 3、要求:屏幕上可以显示La和Lb元素列表,以及合并后单链表Lc元素列表。 -1, by the end of interpolation method to create two types of nodes as the lead character of the ordered single chain La an
trans_matrix_beam3d
- a 3d beam finite element method solver
pro_003
- 这里面有插入法排序算法,快速法排序算法,合并排序算法,还有查找第K小元素法-This insertion method sorting algorithm, fast method sorting algorithms, merge sort algorithm, as well as look for the K-element method
xuanze
- 每一趟从待排序的数据元素中选出最小(或最大)的一个元素,顺序放在已排好序的数列的最后,直到全部待排序的数据元素排完。 选择排序是不稳定的排序方法-Per trip minimum (or maximum) of an element selected from the data elements to be sorted, the order on the last sorted drained until all data elements to be sorted. The selectio
OUIOUIOUIOU
- 题目:对10个数进行排序 1.程序分析:可以利用选择法,即从后9个比较过程中,选择一个最小的与第一个元素交换, 下次类推,即用第二个元素与后8个进行比较,并进行交换。 2.程序源代码: -Title: the number of 10 sorting 1. The program analysis: can use the choice method, that is, from nine after process more, choose a
KHKKUYKYUK
- 题目:请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续 判断第二个字母。 -Title: the number of 10 sorting 1. The program analysis: can use the choice method, that is, from nine after process more, choose a minimal and the first element exchange, So on next time,
