i am getting a problem in calculating output of the following question which i got to solve in a quiz. the code is :-
Consider the following program:
for i from 1 to 12:
MakeSet(i)
Union(2, 10)
Union(7, 5)
Union(6, 1)
Union(3, 4)
Union(5, 11)
Union(7, 8)
Union(7, 3)
Union(12, 2)
Union(9, 6)
print(Find(6))
print(Find(3))
print(Find(11))
print(Find(9))
Assume that the disjoint sets data structure is implemented as an array ({\tt smallest}[1 \dots 12]): ({\tt smallest}[i]) is equal to the smallest element in the set containing (i).
What is the output of the following program? As an answer, enter four integers separated by spaces.
After calculating i got the answer as 1 1 2 1 but it is showing it as incorrect. what will be the correct answer??