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
{{ message }}
This repository was archived by the owner on Sep 6, 2024. It is now read-only.
For the solution, union-find with path compression and a counter are used, which is initialized with a value equal to the number of members of the social network. The counter is decremented after each merge. When all the elements are combined, the counter will have a value of 1.
The solution is weighted union-find with path compression and an array of the same size that contains the values of the maximum element. This value is assigned with path compression and union.
For the solution, union-find with path compression is used. When an element is deleted, it is combined with the next one (which, when the root of the given element is found, will give us a successor).