版本比较
平衡树总结
正文
增加 6 行删除 6 行
165 行未改动全部展开16616716816917017017117217317436 行未改动21121221321421521521621721821954 行未改动2742752762772782782792802812826 行未改动289290291292293294293294295296297298158 行未改动全部展开45745845946046146146246346446538 行未改动165 行未改动全部展开 if(!p){ New(val); p=tot; return ; } } if(val==t[p].val){ t[p].cnt++; pushup(p); return ;36 行未改动 pushup(p); } else p=0; return ; } } if(val<t[p].val){ del(t[p].l,val); } else del(t[p].r,val);54 行未改动 else{ y=p; split(t[p].l,k,x,t[p].l); } pushup(p); pushup(p);}```
6 行未改动 if(!x||!y) return x+y; if(t[x].dat<t[y].dat){ t[x].r=merge(t[x].r,y); pushup(x); return x; } return x; } else{ t[y].l=merge(x,t[y].l); pushup(y); return y;158 行未改动全部展开 int save=root; root=ch[root][0]; f[root]=0; clean(save); return ; return ; } int save=root,befr=befroot(); f[ch[save][1]]=befr; ch[befr][1]=ch[save][1];38 行未改动