@@ -0,0 +1,554 @@
+package week1;%0A%0Apublic class QuickFindUF %7B%0A    private int%5B%5D id;%0A    private int count;%0A%0A    public QuickFindUF(int n) %7B%0A        count = n;%0A        id = new int%5Bn%5D;%0A        for (int i = 0; i %3C n; i++) %7B%0A            id%5Bi%5D = i;%0A        %7D%0A    %7D%0A%0A    public boolean connected(int p, int q) %7B%0A        return id%5Bp%5D == id%5Bq%5D;%0A    %7D%0A%0A    public void union(int p, int q) %7B%0A        int pid = id%5Bp%5D;%0A        int qid = id%5Bq%5D;%0A%0A        for (int i = 0; i %3C id.length; i++) %7B%0A            if (id%5Bi%5D == pid) %7B%0A                id%5Bi%5D = qid;%0A            %7D%0A        %7D%0A    %7D%0A%7D%0A

implement quck find