Homework Assignment

Search Trees

Contents:

  • Overview
  • Practice Problems
  • Problems to be Submitted
  • Extra Credit

  • Overview

    Topic: Search Trees
    Related Reading: Ch. 9.1, Ch. 9.3-9.5.
    Due:

    Please make sure you adhere to the policies on academic honesty.


    Practice Problems

  • Reinforcement Exercise R-9.12.
  • Reinforcement Exercise R-9.13.
  • Reinforcement Exercise R-9.14.

  • Problems to be Submitted (20 points)

    1. (5 points)
      Figure 9.17(f) on page 412 of the text illustrates a particular (2,4) tree. Please draw the (2,4) tree which results from further insertions into this tree of the following sequence of keys in the given order: { 21, 9, 18, 1, 20, 2, 7}. (Note: you do not need to show any intermediate results, so long as the final result is correct).

    2. (5 points)
      Figure 9.17(f) on page 412 of the text illustrates a particular (2,4) tree. Please draw the (2,4) tree which results after deleting the following keys in the given order: { 15, 13, 11}. (Note: you do not need to show any intermediate results, so long as the final result is correct).

    3. (5 points)
      Professor Amongus claims that a (2,4) tree storing a particular set of items will always have the same structure, regardless of the order in which the items are inserted. Show that Professor Amongus is wrong (and ideally give as simple of a counterexample as possible).

    4. (5 points)
      Figure 9.25(q) on page 423 of the text illustrates a particular red-black tree. Please draw the corresponding (2,4)-tree.

    Extra Credit (2 points)

    Do Creativity Exercise C-9.12. Though the problem does not make this explicit, the resulting tree must be a valid (2,4) tree (that is, all leaves must be at the same height).


    Last modified: 15 November 2002