数据结构与算法习题 replacement selection sort(置换选择排序)

该博客介绍了如何使用二元最小堆实现置换选择排序,给出了一组示例输入和输出,详细阐述了该排序方法在数据处理过程中的具体步骤,特别是如何在缓存区管理和输出有序序列。
摘要由CSDN通过智能技术生成

数据结构与算法习题 replacement selection sort(置换选择排序)

Time Limit: 1000ms Memory Limit: 65536kB
Description
Given an original run made up of intergers, and a binary minimumheap,you are required touse the heap to implement the replacement selection sort, and output the firstrun. For example, given a run of 29,14,35,13 and a heap(marked as16,19,31,25,21,56,40), the first run got by using replacement selection sort will be 16,19,21,25.
这里写图片描述
Input
The first line contains two intergers m and n, m is the number of the elements of the original run, n is the size of the binary minimum heap.
The second line contains m intergers, that is the original run.
The third line contains n intergers, the elements of the heap that has been constructed(in order, from the top of the heap to the bottom of the heap, from left to right)
Output
The output contains on

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值