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

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

于 2022-03-17 发布 文件大小:7.42 kB
0 221
下载积分: 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 个回复

  • uart 块核心
    uart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreuart 块 coreu
    2023-01-14 08:25:03下载
    积分:1
  • 实现如何上传图片等,并存储其至库的源码
    实现如何上传图片等数据,并存储其至数据库的源码-How do I upload pictures to achieve the data and store it to database source
    2023-07-29 13:30:03下载
    积分:1
  • 用C++写的寻找公共祖先,实现树的先序后序中序层次遍历,内有实验报告可以参阅。...
    用C++写的寻找公共祖先,实现树的先序后序中序层次遍历,内有实验报告可以参阅。-C wrote for the public ancestors, the first realization of the tree sequence after sequence traversal sequence level, there are experimental report can be found.
    2022-03-06 21:06:58下载
    积分:1
  • 快速库的编程实现
    快速数据库的编程实现-Rapid Database Programming
    2022-03-01 03:15:30下载
    积分:1
  • 这是一个动态创建库的原程序是用c++编写的
    这是一个动态创建数据库的原程序是用c++编写的-This is a dynamic database creation of the original procedure was used to prepare the c
    2022-11-07 03:30:03下载
    积分:1
  • 这是一个经典的动态演示系统,支持C语言和pascal语言,对初学者肯定会有很大帮助...
    这是一个经典的数据结构动态演示系统,支持C语言和pascal语言,对初学者肯定会有很大帮助-This is a classic demonstration of dynamic data structure, and C language support pascal language for beginners certainly be of much help
    2022-02-07 16:28:42下载
    积分:1
  • The bank payment management information system uses the VF edition, may manage t...
    银行支付管理信息系统采用VF编辑,可以管理简单的银行支付系统。- The bank payment management information system uses the VF edition, may manage the simple bank payment system.
    2022-02-04 23:21:28下载
    积分:1
  • 字符串高效匹配算法Sunday,是目前单字符串匹配算法中最为高效的一种。...
    字符串高效匹配算法Sunday,是目前单字符串匹配算法中最为高效的一种。-Efficient string matching algorithm Sunday, is currently the single most efficient string-matching algorithm as a.
    2023-09-06 21:25:03下载
    积分:1
  • 这是一个文档管理系统,由专家开发的,具有很多功能…
    这是一个文档管理系统,有delphi开发的,有很多功能!是我的课程设计!-This is a document management system, developed by Delphi, has a lot of functions. I was the curriculum design!
    2022-03-29 02:57:45下载
    积分:1
  • 往年试题及答案
    数据结构往年试题及答案-Data structure in previous years questions and answers
    2022-02-10 09:42:14下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载