-
[问题描述]
将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
-
全能探针
站长在线版空间探针程序精华包 v0.01 说明:支持PHP,ASP,ASP.NET,IIS,JSP,CGI等类程序环境检测,方便站长朋友选购主机参考。探针程序版权归各自作者所有。将此探针包上传至空间,打开index.html即可显示本页面。
- 2022-03-18 10:08:57下载
- 积分:1
-
use Excel to read the data, the use of VC 6.0, containing "odbcinst.h"...
使用VC++对Excel的数据读取,使用VC++6.0编写,含有《odbcinst.h》头文件编写,如果还有疑问请发邮件给我-use Excel to read the data, the use of VC 6.0, containing "odbcinst.h" The first document preparation, if still in doubt please send an email to
- 2022-03-07 14:32:27下载
- 积分:1
-
学校管理
我附上我的学校管理程序,你可以检查它的费用,入学,课程内容的目的
- 2022-12-02 08:40:03下载
- 积分:1
-
If it is found that the control has prompted unregistered, please run
如果发现有提示控件未注册,请运行"控件注册.bat"注册控件.-If it is found that the control has prompted unregistered, please run
- 2022-08-25 02:53:06下载
- 积分:1
-
用VB6.0实现的最短路径分析,采用了优化的方法(搜索方向一致性)...
用VB6.0实现的最短路径分析,采用了优化的方法(搜索方向一致性)-Using VB6.0 to achieve the shortest path analysis, using optimization methods (search direction consistency)
- 2022-03-16 15:52:46下载
- 积分:1
-
Large databases, triggers (Trigger) knowledge, and its basic programming.
大型数据库,触发器(Trigger)知识,及其基础编程。-Large databases, triggers (Trigger) knowledge, and its basic programming.
- 2022-11-22 13:50:04下载
- 积分:1
-
CSharp下的图书管理系统源码,值得学习
CSharp下的图书管理系统源码,值得学习-CSharp under the library management system source code, it is worth learning
- 2023-06-26 15:10:04下载
- 积分:1
-
2013年北邮预录取上机考试题解答
本次上机考试包括4题,求P点,求日期,求最大值与最小值,和求最小距离。
难度以最P点与求最小距离较难。题目在文件中已包含,写有详细的注释。
- 2022-08-11 05:44:53下载
- 积分:1
-
一元多项式乘法 包含密运算
新学数据结构的可以参考参考 ...
一元多项式乘法 包含密运算
新学数据结构的可以参考参考 -One dollar secret polynomial multiplication operations include the new data structure can refer to reference
- 2022-07-17 11:13:18下载
- 积分:1