Unverified Commit 25ec1273 authored by fearlessxjdx's avatar fearlessxjdx Committed by GitHub
Browse files

缺少新建节点代码

而且上面的描述和代码有点出入,上面写'若 $o$ 为空,直接返回一个值为 $v$ 的新节点。',而实际上代码没有返回值。不知道原意是不是想插入顺便返回插入点下标。
parent ea72878e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -63,7 +63,11 @@ int findmax(int o) {

```cpp
void insert(int o, int v) {
  if (!o) return;
  if (!o) {
    val[o = ++sum] = v; 
    cnt[o] = siz[o] = 1;
  	return;
  }
  siz[o]++;
  if (val[o] > v) insert(lc[o], v);
  if (val[o] == v) {