-
[问题描述]
将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
-
排序算法Sorting algorithm
排序算法Sorting algorithm-Sorting algorithm
- 2022-03-10 00:51:52下载
- 积分:1
-
Sqlite包装v.4.7为对(深版)
SQLite的包装库的源代码,4.7版本可与最新的PBWIN编译器中使用
- 2022-03-17 03:53:35下载
- 积分:1
-
C++ 控制MYSQL数据库 源码
利用C++对MYSQL进行数据读,写,及修改. 需要有mysql.h 头文件
数据库结名为person, 表名为 mm, 表结构如下:
字段 类型
device_id int
sav_value int
sav_date datetime
- 2022-04-11 07:39:31下载
- 积分:1
-
反思分贝
一个开源的分布式JSON文档数据库,带有一个愉快而强大的查询语言。
- 2023-06-02 08:50:04下载
- 积分:1
-
设计模式——简单工厂模式学习代码
一个用c++语言写的、学习简单工厂模式的代码。通过一个父类(OperationFactroy)指针,实现通过判断输入的计算符号而调用加、减、乘、除子类操作的简单代码。
- 2022-01-28 00:00:29下载
- 积分:1
-
基于VC编写的可嵌入WINDOWS的等值线的生成源码.
基于VC编写的可嵌入WINDOWS的等值线的生成源码.-prepared by the VC can be embedded Windows contours of the generation source.
- 2022-04-21 16:56:45下载
- 积分:1
-
Prim 算法寻找最小生成树,用C语言实现,有完整的注释!
Prim 算法寻找最小生成树,用C语言实现,有完整的注释!-Prim algorithm to find the minimum spanning tree, using C language, a complete Notes!
- 2022-03-02 08:32:59下载
- 积分:1
-
零基础学数据结构 第二版 例题代码
- 2022-05-08 08:11:40下载
- 积分:1
-
1.定义二叉树的链式数据结构。
2.编写函数,创建下图所示的二叉树。
3.编写函数输出二叉树的先序、中序、后序遍历。...
1.定义二叉树的链式数据结构。
2.编写函数,创建下图所示的二叉树。
3.编写函数输出二叉树的先序、中序、后序遍历。-1. The definition of binary tree data structure chain. 2. Write a function, create a binary tree as shown in figure below. 3. Write function, the output of the first binary sequence, in order, postorder traversal.
- 2022-11-26 19:05:03下载
- 积分:1