Work Note 10, DM803, fall 2014

Lecture November 11

Exercises November 12

  1. In the lecture on van Emde Boas trees, we claimed that a time complexity of T(n) = 2 T(√n) + 1 was not good enough to get a result better than O(log n). Prove that.
  2. On the other hand, T(n) = T(√n) + 1 should give us O(log log n). Prove that.
  3. What is the base case of findsucc (the operation I referred to as next in the lecture)?
  4. For insertions and deletions, clarify exactly how size, min, and max should be updated.
  5. How would you approach the selection of a data structure with the operations find, insert, delete, succ, and pred in practice?
  6. Consider how to merge two red-black trees in time O(log n), provided that the keys in one tree are all smaller than the keys in the other.
  7. Given a key k, consider how to split two red-black trees in time O(log n) such that all keys smaller than k go into one tree and the rest go into the other.
  8. How can one split a red-black tree in two parts or equal size (±1) in time O(log n)?


Last modified: Mon Nov 10 12:27:03 CET 2014
Kim Skak Larsen (kslarsen@imada.sdu.dk)