package KataProgramming;


public class QuickUnion {

	private int [] id;
	
	public QuickUnion(int N) {
		for(int i=0;i < N ;i++){
			id[i] = i;
		}
	}
	
	private int root(int p){
	
		while (id[p] != p) {
			
			p = id[p];
		}
		
		return p;
	}
	
	public boolean connected(int p, int q){
		
		return root(p) == root(q);
	}
	
	public void union(int p,int q){
		
		int rootOfq = root(q);
		int rootOfp = root(p);
		
		id[rootOfp] = rootOfq;
		
	}
}

@@ -147,16 +147,29 @@
 %09%7D%0A%09%7D%0A%09%0A
+%3C%3C%3C%3C%3C%3C%3C HEAD%0A
 %09private
@@ -186,16 +186,98 @@
 int p)%7B%0A
+=======%0A%09public int root(int p)%7B%0A%3E%3E%3E%3E%3E%3E%3E f88e2bf63b80fed789f82a144fc6ce4cefd9dacd%0A
 %09%0A%09%09whil

fix issue