ST based union find data structure