Question 11

Given a set of N numbers [1,N], partition them into 2 disjoint subsets based on a set of K queries.

Each query is of the type (n1, n2) where n1 and n2 are distinct numbers from the set and n1 and n2

belong to opposite subsets.




N = 4

K = [(1, 2), (1, 3), (2, 4)]


Set 1 : (1,4)

Set 2 : (2,3)

[advanced_iframe securitykey=”undefined” src=”” width=”100%” height=”600″]

Register for the new batch at KodNest and start your journey to success.Secure Your Spot Now!Claim Your Seat

Request A Callback

Get a Free 30-minute Counseling session with our experts.