Create Union Find with rank and path compression