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

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

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

  • 程序在FoxPro创建库和管理接口的
    Program in FoxPro that creates a database and a management interface to the database. Similary to a store database.
    2023-06-09 15:40:08下载
    积分:1
  • 与C语言高级程序设计_0
    数据结构与C语言高级程序设计_0-data structure with the C programming language Huffman High
    2023-05-19 14:35:05下载
    积分:1
  • iweoq FJ vnxcjoiaeafag dfgadfxae
    IWEOQ FJ VNXCJOIAEAFAG DFGADFXAE
    2022-03-04 19:07:53下载
    积分:1
  • 这几个是本人整理的.cpp程序,您可以借鉴参考
    这几个是本人整理的.cpp程序,您可以借鉴参考------>> dos前景背景色设置.cpp 二.八.十.十六进制转换程序的函数.cpp 二叉树的遍历.cpp 图形的广度优先搜寻法.cpp 图形的深度优先搜寻法.cpp 用C语言编的一个日历.c-these are my finishing. Cpp and you can draw reference--- gt; Gt; Dos prospects for the background color set. Cpp two. 8. 10. Hexadecimal conversion function. Cpp binary tree traversal. Cpp graphics priority to search for the breadth of France. Cpp graphics depth-first search of the law. Cpp C language compile a calendar. C
    2022-02-11 17:38:43下载
    积分:1
  • 链接
    数据结构 链表 按顺序合并两链表。 pa =1 2 4 7 9 11 16 pb= 1 6 9 23 24 36 1 1 2 4 6 7 9 11 16 23 24 36-link
    2022-02-02 15:42:46下载
    积分:1
  • 这个程序演示了如何使用ADO做断开的公文包中的应用…
    This program demonstrates how to do disconnected briefcase applications with ADO. When the Connected checkbox is unchecked the application is switched into offline mode. If the application is exited at that point then the data is persisted to a file on disk (along with any edits to the data). When the application is restarted it will load the persisted data if present, otherwise it will fetch the data from the database.
    2022-05-14 15:17:00下载
    积分:1
  • 常用的hash算法APHash,该hash算法可以实现均衡分布,让均匀的分布在hash列表中...
    常用的hash算法APHash,该hash算法可以实现均衡分布,让数据均匀的分布在hash列表中-Commonly used hash algorithms APHash, the hash algorithm can achieve a balanced distribution, so that uniform distribution of data in the hash list
    2022-08-22 19:52:28下载
    积分:1
  • 该程序用Java实现了算法中的动态规划问题_漂亮打印
    该程序用Java实现了算法中的动态规划问题_漂亮打印-the program using Java to achieve a dynamic algorithm planning _ pretty Print
    2022-02-05 15:45:26下载
    积分:1
  • balanced binary tree generating arbitrary input nodes as 2 6 8 0 to demonstrate...
    平衡二叉树生成 输入任意个节点 如 2 6 8 0为显示 可自动生成平衡二叉树 bf为平衡因子 h给深度 可插入删除 计算转动次数(wangliwei007也是我,质料没添全就换这个好号,请斑竹给我发个号好吗?我也想下载东西,急)-balanced binary tree generating arbitrary input nodes as 2 6 8 0 to demonstrate that automatically generates balanced binary tree bf for the balance factor to the depth h can be inserted delete calculated rotational frequency (wangliwei007 me, not Tim material on the whole good for this, please give me a 62-000, okay? I would also like to download something radical)
    2022-05-08 16:28:03下载
    积分:1
  • 设备管理系统,具有参考价值
    设备管理系统,具有参考价值-equipment management system, with reference value
    2023-08-23 13:30:04下载
    积分:1
  • 696518资源总数
  • 104271会员总数
  • 70今日下载