-
[问题描述]
将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N...
[问题描述]
将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N)
[输入]
待排序记录个数,各关键字的值。
[输出]
关键字从正负分开,正数在前
[存储结构]
待排序记录顺序存储。
[算法的基本思想]
快速排序算法每次任取一个记录的关键字为标准,将其余记录分为两组将,N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前。
#include
using namespace std
#define MAXNUM 100//设文件的最长可能长度
void sort(int* keys, const int len)//排序
-[Problem Description] N keyword to the integer sequence the entire record. keyword so that all non-negative Records with the keyword for the negative record, at least require the use of the additional space and time complexity of the algorithm is O (N) [imported] to be sort record number, The value of the keyword. [Output] keyword separate from the pluses and minuses are several former [storage structure] scheduling records to be stored sequence. [Algorithm for the basic idea] quick sort algorithm each time a record for any keyword as a standard, The remaining records will be divided into two groups, N-keyword
- 2022-03-17 21:15:57下载
- 积分:1
-
数据结构CAI系统
数据结构CAI系统-用C语言开发的教学辅助系统。-data structure CAI system-C language teaching aids development of the system.
- 2022-01-21 02:29:46下载
- 积分:1
-
多项式相加 pascal源程序
多项式相加 pascal源程序-polynomial combined source
- 2022-07-23 00:42:09下载
- 积分:1
-
计算圆周率 Pi (π)值, 精确到小数点后 10000 位 只需要 30 多句代码!...
计算圆周率 Pi (π)值, 精确到小数点后 10000 位 只需要 30 多句代码!-Pi calculated pi () values, accurate to 10,000 decimal places only need more than 30 sentence code!
- 2022-07-08 00:29:24下载
- 积分:1
-
射击运动员10发打中90环有多少种可能,递归算法
射击运动员10发打中90环有多少种可能,递归算法-shooting 10 athletes hit the number 90 ring possible, recursive algorithm
- 2022-02-20 19:14:53下载
- 积分:1
-
数据结构双链表的 例子
数据结构双链表的 例子-data structure-Chain example
- 2023-01-31 21:10:03下载
- 积分:1
-
VB学生成绩管理系统,使整套日…
VB student result management system management system, brings the entire wrap the paper, has the very high reference value to the graduation project.
- 2022-04-18 08:23:40下载
- 积分:1
-
使用VC编写的栈的链式表示和实现程序,简单明了,方便使用
使用VC编写的栈的链式表示和实现程序,简单明了,方便使用-Prepared using the VC stack chain expression and realization of program, simple and clear, easy to use
- 2022-12-27 10:35:03下载
- 积分:1
-
顺序表类型的实现,数据结构清华大学严老师C语言第二版算法。...
顺序表类型的实现,数据结构清华大学严老师C语言第二版算法。-order to achieve the type of data structure Tsinghua University teachers strict version of the second C-language algorithm.
- 2022-09-28 02:05:03下载
- 积分:1
-
学生成绩及档案管理信息系统开发 1. 能对与学生成绩有关的各类数据进行输入,修改,与查询。必要时进行打印。 2. 对学生档案有关信息进行管理,输入,与查询。 3...
学生成绩及档案管理信息系统开发 1. 能对与学生成绩有关的各类数据进行输入,修改,与查询。必要时进行打印。 2. 对学生档案有关信息进行管理,输入,与查询。 3. 学期末对成绩进行相关总结并进行排序。 4. 该系统具有各类不同权限,方便用户查询与管理员管理。 5. 具有报错及反馈功能。-student achievement and file management to develop an information system. Can right and the student achievement data for all types of input, modify, and query. When necessary print. 2. The students file relevant information for management, input, and inquiries. 3. End of term related to sum up achievements and sequencing. 4. The system has various powers, user-friendly query and administrator. 5. With errors and feedback function.
- 2022-02-12 08:24:23下载
- 积分:1