-
[问题描述]
将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
-
该源码实现二叉树的模拟,运行时图片已经放在压缩文件夹下。...
该源码实现二叉树的模拟,运行时图片已经放在压缩文件夹下。-The realization of the source tree of the simulation, run-time image compression has on the folder.
- 2022-08-13 08:48:47下载
- 积分:1
-
Algorithm for four
四色算法代码,已经在OMNETPP平台上编译成功!-Algorithm for four-color code has been compiled successfully OMNETPP platform!
- 2023-06-11 13:20:03下载
- 积分:1
-
在顺序存储结构上,采用顺序查找算法,直接插入排序算法等算法查找一关键字,输出查找结果...
在顺序存储结构上,采用顺序查找算法,直接插入排序算法等算法查找一关键字,输出查找结果-In the sequential storage structure, using the sequential search algorithm, sorting algorithm directly into the search for a keyword such as algorithms, the output search results
- 2022-02-04 13:48:57下载
- 积分:1
-
以十字链表表示稀疏矩阵,实现两个矩阵的相加,相减,和相乘的运算....
以十字链表表示稀疏矩阵,实现两个矩阵的相加,相减,和相乘的运算.-List said with a crossbow sparse matrix, the matrix to achieve two together, subtraction, multiplication and arithmetic.
- 2022-03-02 19:04:08下载
- 积分:1
-
Visual C#数据库开发中 简单论坛的开发sql2000数据库
Visual C#数据库开发中 简单论坛的开发sql2000数据库-Visual C# Database development in a simple forum for the development of SQL2000 database
- 2022-04-11 21:55:11下载
- 积分:1
-
一个会议签到系统
一个会议签到系统-a meeting attendance system
- 2023-04-11 08:50:04下载
- 积分:1
-
读取串口的源码
串行口是计算机一种常用的接口,具有连接线少,通讯简单,得到广泛的使用。常用的串口是 RS-232-C 接口(又称 EIA RS-232-C)它是在 1970 年由美国电子工业协会(EIA)联合贝尔系统、 调制解调器厂家及计算机终端生产厂家共同制定的用于串行通讯的标准。它的全名是"数据终端设备(DTE)和数据通讯设备(DCE)之间串行二进制数据交换接口技术标准"该标准规定采用一个 25 个脚的 DB25 连接器,对连接器的每个引脚的信号内容加以规定,还对各种信号的电平加以规定。传输距离在码元畸变小于 4% 的情况下,传输电缆长度应为 50 英尺。
- 2022-02-16 05:22:04下载
- 积分:1
-
Data structure of the famous Tower of Hanoi problem to achieve, based on C++ imp...
数据结构中著名的汉诺塔问题的实现,基于C++实现-Data structure of the famous Tower of Hanoi problem to achieve, based on C++ implementation
- 2022-02-01 19:58:27下载
- 积分:1
-
数据结构中的求强连通分量的源程序,用vc6.0来编写
数据结构中的求强连通分量的源程序,用vc6.0来编写-data structure for the strongly connected component of the source used to prepare vc6.0
- 2023-05-10 23:05:03下载
- 积分:1