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
Agreed, it was previously 1, idk why it was set to 0.
in the merge function there should also be a check if xroot==yroot then return. but urank[x] =0; is a major issue.
void create(ll x) { parent[x] = x ; urank[x] = 0 ; // rank = no. of nodes in its subtree }
In the above create function, urank[x] has to be set to 1. If not this does not serve any purpose. urank of any element will always remain 0
The text was updated successfully, but these errors were encountered: