bloodoath's blog

By bloodoath, history, 2 years ago, In English

Given, two disjoint sets with roots 1 and 6 respectively which already have their childrens' paths compressed.

I wish to do a union but instead of

this

I want

this

Unable to figure out a way to do this optimally.

DSU I am using is on cp-algorithms

Full text and comments »

Tags dsu
  • Vote: I like it
  • 0
  • Vote: I do not like it