Quick find Algorithm