Weekly Note 7, DM42, fall 2006

Discussion Section October 23

  1. For disjoint sets, show that we obtain the same worst-case complexity as for path compression if we use path splitting (every node on the path is set to point to its grandparent from before the find operation) instead.

    Hint: where in the proof do we use that we apply path compression and how is that knowledge used?

  2. Show that the same complexity is also obtained if we use path halving (every second node on the path is set to point to its grandparent).
  3. Considering programming the various path compression alternatives. Which code is more elegant; the one for compression, splitting, or halving?
  4. Problem sheet for weekly note 7 (has been used some years in DM02, so it is fairly simple).
  5. Show that if we use path compression, but there is no requirement when we combine two trees as a result of a union, then all operations can be shown to be amortized O(log n).

    Use for instance a potential function where the potential is the sum of potentials associated with each node, and each node x has a potential proportional to the logarithm of the size of the tree rooted by x. In the analysis of find, it is essential to distinguish between nodes fulfilling the usual union-by-size criterion and nodes which do not fulfill this criterion.

  6. [K90], problems 10.1, 10.2, 10.3, 10.4.

Lecture October 25

Announcements


Last modified: Wed Oct 11 10:27:18 CEST 2006
Kim Skak Larsen (kslarsen@imada.sdu.dk)