-
[问题描述]
将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
-
线性表元素删除运算,删除线性表L中第i个位置上的元素
线性表元素删除运算,删除线性表L中第i个位置上的元素-linear elements to delete Table Operational delete Table L linear section i positions on the elements
- 2023-03-18 20:20:03下载
- 积分:1
-
期末考试日程管理系统,代码免费公开,做的有点大,有4M多了,没办法功夫不到家...
期末考试日程管理系统,代码免费公开,做的有点大,有4M多了,没办法功夫不到家-Final exam schedule management system, code free and open, doing a bit large, there are 4M more, no way to martial arts than at home
- 2023-04-18 19:05:03下载
- 积分:1
-
用链表来实现的一个学生成绩管理管理系统,操作简单,清晰明了。...
用链表来实现的一个学生成绩管理管理系统,操作简单,清晰明了。-With a list to achieve the management of student achievement management system that is simple, clear.
- 2022-01-26 03:13:41下载
- 积分:1
-
prim算法的原理利用 prim算法构造最小生成树。有机的应用prim和数组存储生成树。...
prim算法的原理利用 prim算法构造最小生成树。有机的应用prim和数组存储生成树。-prim algorithm using the principle of Minimum Spanning Tree Algorithm prim. Application of organic prim and storage arrays spanning tree.
- 2022-02-02 09:09:52下载
- 积分:1
-
链表,学生成绩记录
这是一个学生成绩的记录表练习,是数据结构中的链表实现的,对初学者有很大帮助,自己写的,多有不足,请大家一起完善。
- 2022-08-11 20:45:26下载
- 积分:1
-
完成输入图,然后进行图的深度优先遍历
完成输入图,然后进行图的深度优先遍历-Complete the input map, and then proceed to map the depth-first traversal
- 2022-02-05 12:59:49下载
- 积分:1
-
VHDL实现布斯算法
VHDL实现布斯算法-VHDL Booth algorithm
- 2022-02-04 04:17:51下载
- 积分:1
-
N皇后问题的解决方案,利用回归的方法.方法易懂
N皇后问题的解决方案,利用回归的方法.方法易懂-N Queens solution to the problem, using regression. Methods to understand
- 2022-07-22 20:59:12下载
- 积分:1
-
迷宫问题 数据结构
迷宫问题 数据结构-maze data structure problem
- 2022-03-14 12:54:31下载
- 积分:1