quick union implements a simple tree structure by array