摘要:
#include <iostream> #include <vector> using namespace std; /// 合并 void merge(vector<int>& nums, int l1, int r1, int l2, int r2, vector<int>& tmp) { in 阅读全文
摘要:
堆排序主要分为两个函数: 1、构建堆 2、元素调整 ``` #include using namespace std; void maxHeap(int tree[], int n, int i) { if (i >= n) return; int lchild = i*2 + 1; int rch 阅读全文