for i := 1 to 16 do MakeSet(i); for i := 1 to 15 by 2 do Union(i,i+1); for i := 2 to 14 by 4 do Union(i,i+2); Union(4,8); Union(12,16); Union(8,16); writeln(Find(2)); writeln(Find(9))
4 1 3 5 1 2 3 3 2 1 4 1 3You may write your program in C, C++, Pascal, or Object Pascal. If your program is designed to run on the Suns, use the "turnin" program to submit it. If it is designed to run on the Macs, put it in the dropoff folder on Cider Press for CS256.
Your program should use the most efficient data structures discussed in class and run as quickly as possible.