登录
首页 » 数据结构 » [问题描述] 将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N...

[问题描述] 将N个关键字去整数的记录进行整序, 以使所有关键字为非负数的记录排在关键字为负数的记录之前,要求使用最少的附加空间,且算法的时间复杂度为O(N...

于 2022-03-17 发布 文件大小:7.42 kB
0 227
下载积分: 2 下载次数: 1

代码说明:

[问题描述] 将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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 进制转换是中的栈的应用的一个典型例子
    进制转换是数据结构中的栈的应用的一个典型例子- Enters the system transformation is in a construction of data stack application typical example
    2022-10-02 01:30:03下载
    积分:1
  • 100个vfp 小程序源码,对于初学者来说很有用
    100个vfp 小程序源码,对于初学者来说很有用-100 -100 VFP applet source code, useful for beginners-100
    2023-07-10 07:55:02下载
    积分:1
  • 1, for providing patients with better and faster and more efficient services and...
    1、为病人提供更好更快、更快的服务,提高医院在医疗市场的竞争力以及吸引更多的病人到本医院就医; 2、人力工资昂贵,迫使医院采用计算机以提高劳动效率; 功能:1、门诊挂号:为病人提供就医卡方便病人; 2、住院病人管理系统:是医院可以随时了解病人情况; 3、药房管理系统:提高了药品管理的质量,和工作效率; 4、门诊医生工作站、住院费用的管理、病历管理系统、以及外部接口等。-1, for providing patients with better and faster and more efficient services and improve the hospital in the medical market competitiveness and to attract more patients to the hospital 2, manpower, high cost of labor, forcing hospitals to improve the working efficiency of the computer function : 1, out-patient registration: In order to provide patients with the convenience of patients for medical treatment card 2, patients management system: a hospital patient can understand 3, pharmacy management system: To improve the quality of drug management, and efficiency 4, the doctor-patient workstations, the cost of hospital management, medical records management system, as well as external interfaces.
    2023-05-18 04:40:04下载
    积分:1
  • 用VB+access库设计的学生公寓管理信息系统.有一定实用参考价值!...
    用VB+access数据库设计的学生公寓管理信息系统.有一定实用参考价值!-VB access database design student apartment management information systems. Have practical value!
    2022-09-07 23:55:03下载
    积分:1
  • 教程代码 严蔚敏 上机实验操作代码
    数据结构教程代码 严蔚敏 上机实验操作代码-Data Structure Course Code YAN Wei-min experimental operation on machine code
    2022-03-22 19:43:11下载
    积分: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
  • calc24point application components of each document summary of the contents.
    此文件包含组成 calc24point 应用程序的每个文件的内容摘要。-calc24point application components of each document summary of the contents.
    2022-04-13 07:33:43下载
    积分:1
  • 股票自动交易软件
    实现中投软件股票的自动交易成交而不需要天天让人来看盘,这样很辛苦的,我炒股票的人事解放体力,不可多得的一份软件,有兴趣的朋友可以扩充,不过有关技术请注明出处,谢谢.新程触控一体机,教育智能平板适合炒股的大公司使用,可以交互式让炒家看股票软件的
    2023-07-06 18:05:03下载
    积分:1
  • 汉诺塔演示 文本界面的
    汉诺塔演示 文本界面的-HANOR demo version of the interface
    2022-05-30 17:44:44下载
    积分:1
  • 连续和问题的啦 还不错的 没看过的一起来看
    连续和问题的啦 还不错的 没看过的一起来看-Continuous and the problem did not you also a good read together
    2022-06-30 09:22:56下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载