RT,比如我在树上维护子树内的点,用 vector+启发式合并,然后因为我的写法都是直接
vector+启发式合并
vector<int>*p,*h; p=new vector<int>,h=new vector<int>; swap(p,h);
如果是链的话空间复杂度不就 n^2 了?怎么优化?