Блог пользователя bloodoath

Автор bloodoath, история, 20 месяцев назад, По-английски

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

Полный текст и комментарии »

Теги dsu
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится