Final, CSCI 385, Fall 2006
- Use as much paper as you wish, but please label each question.
- Please write legibly.
- When you are asked to give example algorithms, use only named algorithms we have discussed in class.
- [10 points] Define/describe the following terms.
- Tree
- Binary Tree
- Binary Search Tree
- Height Balance Property
- AVL Tree
- [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 points] Give an example of a tree of height at least 3 that violates the Height balance property.
- [10 points] In an AVL-tree,
- what is a rotation
- What does a rotation accomplish?
- How can you tell that a rotation is needed?
- Draw a figure illustrating a rotation. Label the data and
heights of all nodes in your example both before and
after the rotation.
- [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.
- Insertion Sort
- Bubble Sort
- Selection Sort
- Quick sort
- Bin/Radix Sort
- [5 points] State the algorithm for merge sort and merge.
- [5 points] Derive the performance expectations for merge sort.
- [5 points] Describe the complexity classes P and NP.