Hi there!
I just encountered a problem on a forum seemingly uses DSU, but there is a query that makes me question my DSU.
There are a number n and n numbers that follow. There are 3 queries: + Put a and b together + Seperate a and b + Determine whether a and b is connected
I am thinking of a reverse-DSU technique.
Please help!
P/S: Thank you!