学习:堆排序(大顶堆)
#include <iostream>
#include <cassert>
#include <ctime>
#include <cstdlib>
using namespace std;
template <class T>
class MaxHeap
{
private:
T *data;
int count;
int capacity;
void shiftUp(int k)
{
while(k>1 && data[k/2] < data[k])
{
swap(data[k/2] , data[k]);
k/=2;