You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general, I think for data structures that can be augmented, like segtrees or (as we recently learned) Link Cut Trees, we should try to separate the code that's meant to be augmented from the rest of the code.
I have tried to augment LinkCutTree with the subtree size, however I can't get it to work.
I have added
int sz = 1;
as a field toNode
and modifiedNode::fix()
to contain:My test code is
I would expect the output to be:
But instead I get:
The full code is available at https://gist.github.com/Tyilo/ebbbd06dcb02665c078ec3dac387c09a
The text was updated successfully, but these errors were encountered: