-
[问题描述]
将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
-
sqlite是一种嵌入式数据库。本文件包含了操作此数据库的一个类。该类实现了sqlite的所有操作,并具有良好的注释说明。...
sqlite是一种嵌入式数据库。本文件包含了操作此数据库的一个类。该类实现了sqlite的所有操作,并具有良好的注释说明。-sqlite is an embedded database. This document contains the operation of this database, a class. Sqlite class implements all the operations, and has a good explanatory notes.
- 2022-03-19 00:27:37下载
- 积分:1
-
a binary tree using the trigeminal Chain example, the leaves are obtained and th...
一个二叉树的三叉链表运用实例,求出叶子的结点并输出从根结点到该叶子结点的路径!-a binary tree using the trigeminal Chain example, the leaves are obtained and the output node from the Root of leaf nodes in the path!
- 2022-02-21 08:16:56下载
- 积分:1
-
TRegExpr易于使用和强大的工具,复杂的搜索和替换…
TRegExpr is easy to use and powerfull tool for sophisticated search and substitutioning and for template-based text checking (especially usefull for user input validation in DBMS and web projects).
- 2022-03-03 08:12:00下载
- 积分:1
-
java程序实现的通俗易懂的二分查找的算法源代码
java程序实现的通俗易懂的二分查找的算法源代码-java program to achieve the user-friendly dichotomous search algorithm source code
- 2022-02-04 20:18:19下载
- 积分:1
-
数据结构 c语言 教程
数据结构 c语言 教程-language data structure c Guide
- 2022-03-17 11:31:19下载
- 积分:1
-
随机产生一个迷宫。可以找出一条可以通过的路径。也可以找出全部可以通过的路径。...
随机产生一个迷宫。可以找出一条可以通过的路径。也可以找出全部可以通过的路径。-randomly generated a maze. To be able to find a path through. All can find the path through.
- 2022-03-01 11:49:19下载
- 积分:1
-
Windows和Unix下的Oracle通用C开发库
Windows和Unix下的Oracle通用C开发库-Windows and Unix Oracle general C development storehouse
- 2023-03-01 16:20:04下载
- 积分:1
-
最小二乘逼近(最小
最小二乘逼近(least-squares approximation)得到一组离散(discrete)数据点的近似函数(approximating function),实验数据往往是用最小二乘逼近得到一条秘密曲线(curve fitting)。下面概述的是最小二乘近似作为多项式的近似函数,除了多项式外,指数的几个右公式也可以作为类似的函数使用。关于最小平方近似的计算原理,请参考市场上的数值分析书籍
- 2022-06-02 22:53:44下载
- 积分:1
-
circular linked list node wait
环形链表结点出排-circular linked list node wait-
- 2022-02-27 07:00:39下载
- 积分:1