rt
void deb1(int x){
cout<<x<<(mk[x]?"b":"r");
if(son[x][0] || son[x][1]){
if(son[x][0]){
cout<<"[";
deb1(son[x][0]);
cout<<"]";
}else{
cout<<"[-]";
}
if(son[x][1]){
cout<<"[";
deb1(son[x][1]);
cout<<"]";
}else{
cout<<"[-]";
}
}
}
void debug(int x){
#ifndef ONLINE_JUDGE
deb1(x);
cout<<'\n';
#endif
}
注意自己改变量名
当然以上加入到平衡树的代码种(那个mk可以指代某个表现在树上的tag(从文艺平衡树上弄下来的))
然后将调用debug(x)的结果复制粘贴到这里
https://hggshiwo.github.io/bitreepainter/index.html
就可以看间树长什么样子了