-
[问题描述]
将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
-
二叉树遍历的递归算法,帮助理解程序设计过程中的递归思想,以及二叉树遍历的基本思想...
二叉树遍历的递归算法,帮助理解程序设计过程中的递归思想,以及二叉树遍历的基本思想-Recursive binary tree traversal algorithm, to help understand the program design in the process of recursive thinking, as well as the basic idea of binary tree traversal
- 2022-05-31 12:09:42下载
- 积分:1
-
这是一个连接数据库的类,非常有用,感谢指教
这是一个连接数据库的类,非常有用,感谢指教-This is a type of database connections, very useful
- 2022-09-22 23:15:02下载
- 积分:1
-
OJ 1100 North online title, the success of the use of automata to solve the clas...
北大在线OJ 1100题,运用自动机成功求解方程式的经典例子,此程序可作为自动机模板-OJ 1100 North online title, the success of the use of automata to solve the classic example of the equation, this procedure can be used as a template automaton
- 2022-11-09 02:40:03下载
- 积分:1
-
栈的基本操作,有初始化,清空,添加,删除,判空等!
栈的基本操作,有初始化,清空,添加,删除,判空等!-stack the basic operation, initialization, emptied, add, delete, subcontracting air!
- 2022-02-14 14:00:29下载
- 积分:1
-
用VB6.0进行solidworks的二次开发,包括数据库操作,零件的参数化生成等应用。...
用VB6.0进行solidworks的二次开发,包括数据库操作,零件的参数化生成等应用。-SolidWorks using VB6.0 for secondary development, including database operations, parts of the parametric generation of applications.
- 2022-01-22 03:32:16下载
- 积分:1
-
C数据结构常用算法程序集2,描述数据结构算法。
C数据结构常用算法程序集2,描述数据结构算法。-C data structures commonly used algorithm Set 2, describe data structure algorithms.
- 2022-01-28 14:48:30下载
- 积分:1
-
data structure
数据结构――动态规划算法-data structure-- Dynamic Programming
- 2023-08-05 10:50:03下载
- 积分:1
-
图的深度优先算法,这个算法非常的实用,应该经常被用到
图的深度优先算法,这个算法非常的实用,应该经常被用到-map the depth priority algorithm, the algorithm is very practical, should always be used
- 2022-05-31 04:53:02下载
- 积分:1
-
采用模版函数对数据结构的线性列表和栈以及队列进行编程。...
采用模版函数对数据结构的线性列表和栈以及队列进行编程。-template function using the data structure of the linear list and Stack and Queue program.
- 2022-07-28 16:19:24下载
- 积分:1