Midterm 2 Study Guide

This midterm covers chapters 5 through 7. Here is a list of the main ideas:

  1. What is the general approach in the divide-and-conquer technique? How does it differ from the decrease-and-conquer technique?
  2. What does the master theorem say about the solution to the recurrence relation \(T(n) = a T(n/b) + f(n)\)? How does this relate to the divide-and-conquer technique? What do the parameters \(a\), \(b\), \(f(n)\) represent in the divide-and-conquer context?
  3. Be able to use the master theorem (e.g. exercise 5.1.5)
  4. Describe the mergesort algorithm, and outline the general algorithm for it.
  5. Describe the overall plan for the quicksort algorithm.
  6. Explain what internal and external nodes are in a binary tree and why the number of external nodes is always one more than the number of internal nodes.
  7. Be able to write down common divide-and-conquer algorithms for binary trees such as determining the tree height, the number of external nodes, and whether a tree is in fact a binary search tree.
  8. Be able to name, describe and use the three traversal approaches to binary trees.
  9. What are the three different forms that transform-and-conquer algorithms take? Describe each form.
  10. Show instances where presorting an array can lead to more efficient algorithms. In particular, be able to explain how presorting can help with finding if there are any duplicate elements in the array and also to find what the smallest absolute difference between array elements is. Determine the time efficiency of solutions to these problems using presorting and also using a more brute-force approach.
  11. AVL Trees:
  12. 2-3 Trees: Describe the two kinds of nodes that 2-3 trees have, what further property 2-3 trees have, and how to search in a 2-3 tree.
  13. Heaps:
  14. Hashing: