Final, CSCI 385, Fall 2006

  1. [10 points] Define/describe the following terms.
    1. Tree
    2. Binary Tree
    3. Binary Search Tree
    4. Height Balance Property
    5. AVL Tree
  2. [2 points] Give an example of an AVL tree of height at least 3. Store integer data in the tree, and write the data values inside of the nodes.
  3. [3 points] Give an example of a tree of height at least 3 that violates the Height balance property.
  4. [10 points] In an AVL-tree,
    1. what is a rotation
    2. What does a rotation accomplish?
    3. How can you tell that a rotation is needed?
    4. Draw a figure illustrating a rotation. Label the data and heights of all nodes in your example both before and after the rotation.
  5. [10 points] For each of the following sorts, state the performance expectations for both space and memory. State where it would be advantageous to use the sort.
  6. [5 points] State the algorithm for merge sort and merge.
  7. [5 points] Derive the performance expectations for merge sort.
  8. [5 points] Describe the complexity classes P and NP.