Implementation of quick union balanced