in Python
14. (6 points) Consider the following code fragment where S is used to represent a disjoint set forest. Show the configuration of the S after the code is executed. int [] S = new int [9]; initialize(S); for (int į-1;jcs.length ; İ”1+2) union(S,1,1-1); 15. (14 points) Write a method that receives a disjoint set forest S that was created using union-by beight and prints the number of sets encoded by S and the length of the longest path in S. 10. (14 points) Write a method that receives integers n and k and builds and returns a disjoint set forest encoding n sets, each with k elements. Thius the first k elements would belong to one set, the next k elements to another, and so on. For example, if your method receives n 2 and k 3, it should create s-n {(0,1,2), {3,4,5)); if it receives n a 3 and k 2, it should create S-((0, i }.(2,3). [4,5)) and if it receives n 3 and k 1 it should create S t(0),(), (2)