摘要:
示例: 合并方法: 示例代码: #include <stdio.h> #define LEN 8 // 合并 void merge(int a[], int start, int mid, int end) { int n1 = mid - start + 1; int n2 = end - mid 阅读全文
posted @ 2020-08-20 16:14
1点
阅读(710)
评论(0)
推荐(0)
摘要:
按钮: <el-button type="primary" @click="exportBtn" class="ml20">导出</el-button> 方法:先调接口 exportBtn(){ if(this.tableData.length 0 ){ this.$message.error('暂 阅读全文
posted @ 2020-08-20 14:06
1点
阅读(945)
评论(0)
推荐(0)
摘要:
代码: #include <stdio.h> typedef int ElementType; int arr1[11] = {0, 2, 87, 39, 49, 34, 62, 53, 6, 44, 98}; #define LeftChild(i) (2 * (i) + 1) void Swap 阅读全文
posted @ 2020-08-20 11:02
1点
阅读(594)
评论(0)
推荐(0)
摘要:
在上文构建好2叉堆后 进行堆排序 在堆创建好后,每次取出堆顶元素,并且调整堆,把堆顶元素放在数组最后即可。 我们将堆顶元素与堆的最后一个元素进行交换 得到 此时要进行调整 调整都是从父节点、左孩子节点、右孩子节点三者中选择最大者跟父节点进行交换 对 3 17 8 进行调整 得到 还不符合 对 3 7 阅读全文
posted @ 2020-08-20 10:11
1点
阅读(299)
评论(0)
推荐(0)

浙公网安备 33010602011771号