摘要:
特点 采用数组模拟堆结构 当前节点标号为t,左儿子为2t,右儿子为2t+1 两个操作构成其他操作的子操作 down:cur节点与最小的子节点交换,递归向下,调整堆结构 up: cur节点与父节点比较,递归向上,调整堆结构 支持的操作 添加一个元素 heap[++size], up(size); 删除 阅读全文
posted @ 2025-04-13 16:03
Biang-Biang
阅读(40)
评论(0)
推荐(0)
摘要:
快速排序模板 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N]; void quickSort(int l, int r){ if(l>=r) return; int mid=a[l+r>>1]; int 阅读全文
posted @ 2025-04-13 14:52
Biang-Biang
阅读(89)
评论(0)
推荐(0)

浙公网安备 33010602011771号