-
[问题描述]
将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
-
sqlitebrowser
SQLite浏览器-1.3-src.tar.gz文件伟大的
- 2022-03-23 10:41:55下载
- 积分:1
-
2-3树的数据结构以及演示程序-2-3 tree data structure and Demonstration Program
- 2022-01-26 00:29:51下载
- 积分:1
-
mapreduce的工具软件。来源为ibm 的技术论坛。
mapreduce的工具软件。来源为ibm 的技术论坛。-mapreduce software tools. Source for ibm technical forum.
- 2022-03-11 17:05:11下载
- 积分:1
-
输入以字符串,依顺序表存储,查找一个元素,删除一个元素...
输入以字符串,依顺序表存储,查找一个元素,删除一个元素-Input to a string, depending on the order of tables to store, find an element, delete an element
- 2022-02-05 12:29:55下载
- 积分:1
-
ACESS数据库使用时间长了之后,数据库文件后变得越来越庞大,本程序里的函数可以实现对ACESS进行压缩
另外,当机器突然断电,可能对DB造成损坏,该函数...
ACESS数据库使用时间长了之后,数据库文件后变得越来越庞大,本程序里的函数可以实现对ACESS进行压缩
另外,当机器突然断电,可能对DB造成损坏,该函数也可实现修复-Acess database to use a long time after the database file after becoming increasingly large, the program can realize the function of Acess to compress the other hand, when a sudden power failure the machine may cause damage to DB, this function can also realize Repair
- 2022-05-14 17:27:34下载
- 积分:1
-
北京公交路线查询系统
北京公交路线查询系统-Beijing Bus Route Query System
- 2022-01-26 03:20:50下载
- 积分:1
-
关于数据库学习的
关于数据库学习的
关于数据库学习的
关于数据库学习的-shujk
- 2022-02-02 21:36:05下载
- 积分:1
-
金华门禁系统数据库脚本,包括门、EL键盘照明…
金华门禁系统数据库脚本,涵盖了门禁,售饭,人力资源管理等-Jinhua Access Control System database scripts, covering doors, EL keyboard Illumination, human resource management, etc.
- 2022-02-26 11:30:07下载
- 积分:1
-
宾馆管理信息系统
宾馆管理信息系统-Hotels Management Information System
- 2022-02-04 23:55:41下载
- 积分:1