#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int heap[N], siz;
int n, m;
void down(int i) {
int t = i; //t记录i与它的两个子节点中最小的那个节点的编号
if (i * 2 <= siz and heap[i * 2] < heap
堆排序模板 输入一个长度为n的整数数列,从小到大输出前m小的数。
最新推荐文章于 2021-12-20 19:51:45 发布