@Override
	public void union(int p, int q)
	{
		int pRoot = find(p); // component of p
		int qRoot = find(q); // component of q

		// Do nothing if p and q belong to the same component
		if (pRoot == qRoot)
			return;

		// Label the component-id of pRoot as qRoot, thus effectively making the
		// component-id of all vertices whose actual component-id was pRoot
		// (by the virtue of being led to pRoot through their component-id's)
		// now as qRoot
		id[pRoot] = qRoot;

		componentCount--;
	}