-
[问题描述]
将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
-
数据结构单链表的实现,包含链表元素的删除,查找,插入
数据结构单链表的实现,包含链表元素的删除,查找,插入-single linked list data structure to achieve List contains elements delete, retrieve, insert
- 2022-07-27 15:47:15下载
- 积分:1
-
很多的vb经典源代码
很多的vb经典源代码-many classic vb source code
- 2022-04-26 19:34:12下载
- 积分:1
-
rda1846 C和DOC
射频rda1846芯片c源代码和设置值xlc文件
- 2022-01-22 11:03:27下载
- 积分:1
-
一步 学VB2005数据库编程,WROX出品,Roger Jennings编写,啥也不多说了,学VB.NET必看的精品
一步 学VB2005数据库编程,WROX出品,Roger Jennings编写,啥也不多说了,学VB.NET必看的精品-Database Programming VB2005 step Xue, WROX produced, Roger Jennings writing, what not to say, the school must-see boutique VB.NET
- 2022-04-22 01:39:38下载
- 积分:1
-
Photo Database Access
数据库中图片的存取-Photo Database Access
- 2023-01-15 11:30:04下载
- 积分:1
-
以源代码形式的库存管理系统
这是一个完整的库存管理系统,并配备了完整的源代码。
这个代码学习起来很有趣。
- 2022-05-26 08:07:43下载
- 积分:1
-
回溯法的模板,关键是回溯的过程,以及在深搜过程中的方向问题...
回溯法的模板,关键是回溯的过程,以及在深搜过程中的方向问题-Backtracking template, the key is back process, as well as in the course of the deep question of the direction search
- 2022-06-15 15:31:48下载
- 积分:1
-
短信开发利用kfxt和MSComm控件
sms develop use kfxt and mscomm
and suce-sms develop and use kfxt mscomm and suce
- 2022-08-08 19:25:25下载
- 积分:1
-
N-皇后问题线性时间算法
O(n)复杂度,非O(n^2)的,使用的是构造法。-N-Queen problem of linear time algorithm
- 2023-05-09 15:10:02下载
- 积分:1