Grouping elements in no time with the disjoint-set data structure (Union-Find) - Inside code

preview_player
Показать описание

NB: This video is ad-free, you can choose to support Inside code by purchasing one of the courses above or dropping a super thanks!
NB2: Discounts of courses above are permanent

Рекомендации по теме
Комментарии
Автор

Thank you, I would recommend to link few problems from leetcode for practice related to any data structure you teach
You picking few problems(important) will reduce leetcode fatigue

mallakbasheersyed
Автор

I may be wrong, but if we only care about the root of the element's set, why don't we just find the root of element x when uniting, and set it to the root of element y? That would make the find() method's time complexity O(1).

filipwolinski