-
[问题描述]
将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
-
SQL入门使用与高级使用篇。 SQL入门使用与高级使用篇。
SQL入门使用与高级使用篇。 SQL入门使用与高级使用篇。-SQL entry with the use of the use of the High chapter. SQL entry with the use of the use of the High chapter.
- 2022-06-22 04:07:35下载
- 积分:1
-
ADO直接读取数据库的编程实例
ADO直接读取数据库的编程实例-read directly ADO database programming examples
- 2022-03-29 12:09:20下载
- 积分:1
-
实用的SQLite C++封装类
SQLite的封装类,简单实用,支持常用操作!
自己感觉封装的不错,运行平台有:windows、linux、unix。
如果有什么问题和建议,请邮件yin0123@sina.com
- 2022-11-08 15:15:03下载
- 积分:1
-
该程序提供对需要进行遍历的树的自定义输入,并可以在对树进行先序线索化之后遍历该树。...
该程序提供对需要进行遍历的树的自定义输入,并可以在对树进行先序线索化之后遍历该树。-the procedures needed to traverse the tree from the definition of import, and to be right tree for first sequence of clues after traversal of the tree.
- 2022-06-17 13:06:07下载
- 积分:1
-
文件包含的内容: 常见的algorithm,使用vc6开发的 包括排序算法...
文件包含的内容: 常见的algorithm,使用vc6开发的 包括排序算法-document contains elements : common algorithm used in the development vc6 Sorting Algorithm
- 2022-11-06 22:20:03下载
- 积分:1
-
数据结构汉诺塔
数据结构汉诺塔-data structure HANOR
- 2023-04-19 01:20:03下载
- 积分:1
-
Delphi 2007 Remobjects分布式ERP模型
Delphi 2007 Remobjects分布式ERP模型-Delphi 2007 Remobjects Distributed ERP model
- 2023-03-30 21:40:03下载
- 积分:1
-
常用的数据结构,高斯
数据结构中常用的Gauss-Seidel 迭代算法-commonly used data structures, the Gauss- Seidel iterative algorithm
- 2022-05-22 13:00:57下载
- 积分:1
-
Access database user rights management procedures, Delphi, reprinted
Access数据库用户权限的管理程序,Delphi,转载-Access database user rights management procedures, Delphi, reprinted
- 2022-05-16 21:51:45下载
- 积分:1