Weighted Quick Find Algorithm