Adds quick union algorithm