Worst-case analysis of the set-union problem with extended backtracking

Giorgio Gambosi, Giuseppe F. Italiano, Maurizio Talamo
1989 Theoretical Computer Science  
In this paper, an extension of the well known set union problem is considered, where backtracking over sequences of Union operations is allowed. A data structure is presented which maintains a partition of zn n-item set making it possible to perform each Union in O(1g lg n) time, each Find in O(lg n) time and allows backtracking over the Unions in O(1) time. Moreover, it is shown that the data structure can be slightly modified as to present an O(k i-in lg n) time complexity on a sequence of k
more » ... nions and Backtracks and m Finds. The space complexity of both versions of such a data structure is O(n). The set-union problem, togl;ther with its variants, is certainly one of the most extensively studied problems in recent years [l, 3, 4, 9, H-13, 15, 18, 19, 21, 22, 241. The original problem is that of maintaining a representation of a partition of aset S={l,2,..., n} in equivalence classes under the following two operations: Unio&K, f): return a new partition of S in which classes X, Y are merged into a new equivalence class X u Y named X. Find (x) : given an item y E s, return the name of the equivalence class containing A. At the begirnning, t artition consists o if singletons {I}, {2}, . . . 5 { e of the initial set {i} is i.
doi:10.1016/0304-3975(89)90119-9 fatcat:ezn6iw2rkrfhnkpzjbeidfzkfu