Yes, there is a corresponding lower bound due to Michael J. Fisher in 1972 (see section 3). In his example, a binomial tree of depth log n is used, where a binomial tree of depth 0 is the only node, and a binomial tree of depth k is two binomial trees of depth k - 1 with a root of one pointing to the root of the other. Repeating the union of the binomial tree root to point to a singleton and performing a search on the deepest node, we perform an expensive (logarithmic operation) operation that leaves another embedded binomial tree for use.
Python demo: this prints (k+1) * 2**k , where k is the example argument representing an approximate operation counter for O(2**k) operations on O(2**k) keys.
p = {} def find(a): global count b = a while (b in p): count += 1 b = p[b] while (a in p): pa = p[a] p[a] = b a = pa return b def union(a, b): p[find(a)] = find(b) def deepest(): maxd = (0, None) for (a, pa) in p.items(): d = 1 while (pa in p): d += 1 pa = p[pa] maxd = max(maxd, (d, a)) return maxd[1] def example(k): global count, p count = 0 p.clear() for a in range(((2 ** k) - 1), 0, (- 1)): union(a, (a & (a - 1))) r = 0 for a in range((2 ** k), (2 ** (k + 1))): union(r, a) find(deepest()) r = a example(9) print(count)
David Eisenstat
source share