0
$\begingroup$

Here is the question: enter image description here

I understand that the absolute parents are 1, 3, 0, and 8, respectively, but I'm not sure how to do union here. Could someone help me understand how to do this?

asked Apr 27, 2024 at 3:27
$\endgroup$
2
  • $\begingroup$ Just blindly follow the procedures given for the $Union$ and $Find$ operations. $\endgroup$ Commented Apr 27, 2024 at 13:14
  • $\begingroup$ Please don't use images of text or mathematics. This makes your question impossible to search and inaccessible to the visually impaired; we don't like that. Please transcribe text and mathematics. You can use LaTeX. Also, we require you to provide attribution for the source where you are obtaining this problem/material from. $\endgroup$ Commented Apr 28, 2024 at 4:19

1 Answer 1

1
$\begingroup$

To take the first question, (i).

When you want to perform union(8, 9) you do r1 = find(8) and r2 = find(9), and then you let either r1 point to r2 or vice versa.

In this case, they have the same rank, and as it says, you should break even by spring by index, hence 8 should point to 0.

answered Apr 27, 2024 at 6:48
$\endgroup$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.