堆排序(大根堆)
#include<iostream>
#include<cstdlib>
using namespace std;
void Swap(int *heap, int i, int j); /* 交换节点 */
void BuildMaxHeap(int *heap, int start, int len);/* 构建大顶堆 */
void Swap(int *heap, int i, int j)
{
int temp;
temp = heap[i];
.
原创
2020-06-16 19:35:29 ·
158 阅读 ·
0 评论