-
[问题描述]
将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
-
拉斯维加斯,KMP模式匹配算法,mentro Carlo三的原始股份有限..
Las Vegas,KMP,Mentro carlo这三种模式匹配算法的原代码,对其进行了时间及出错率的比较-Las Vegas, KMP, Mentro carlo three pattern matching algorithm of the original code, its time and the error rate comparison
- 2022-05-24 23:20:37下载
- 积分:1
-
The realization of a number of algorithms, using the pascal, including number th...
一些算法的实现,用的是pascal,包括数论、图论、高精度计算、排序算法、背包问题等。-The realization of a number of algorithms, using the pascal, including number theory, graph theory, high-precision computing, sorting algorithms, and so on knapsack problem.
- 2022-02-05 22:21:10下载
- 积分:1
-
一个封装好的产生随机数的类,十分好用,是学数据结构是写的,希望对大学有用...
一个封装好的产生随机数的类,十分好用,是学数据结构是写的,希望对大学有用-Generate a good random number package class, very easy to use is data structure is written in the hope of the University of useful
- 2022-01-31 13:43:50下载
- 积分:1
-
SQL 数据库
用VB和matlab混合编程,编写的数据库,数据库包含有删除,添加,修改,插入 及查看等功能,在利用VB和SQL联系起来,由于matlab强大的算法功能,将输入各类数据进行用算后存入数据库。
- 2022-04-18 13:57:17下载
- 积分:1
-
delphi 制作的电梯程序
资源描述delphi 制作的电梯程序,智能控制上下人数,停留层完全按照实际操作来,设计结构精细,适合练手.组件简单
- 2022-02-05 21:09:29下载
- 积分:1
-
各种算法的演示程序,十分直观,学习算法必备!
各种算法的演示程序,十分直观,学习算法必备!-Various algorithm demo program is very intuitive, learning algorithm must have!
- 2023-08-24 03:00:03下载
- 积分:1
-
数据结构一元多项式的实现
数据结构一元多项式的实现-data structure of one yuan achieve polynomial
- 2022-03-20 08:22:11下载
- 积分:1
-
校园导游图算法
校园导游图算法--数据结构中有关图的算法按v求最短路径按s求信息;按q退出;地图在map图像文件里-campus tour map algorithm-- data structure of the plan according to the algorithm for the shortest path v s by seeking information; Q withdrawal by; Maps map image file
- 2023-05-25 01:50:03下载
- 积分:1
-
used to demonstrate each Treeview Field
用Treeview来显示每个Field-used to demonstrate each Treeview Field
- 2022-09-04 00:10:03下载
- 积分:1