Test Review for CMPS 2200, Fall 2014

Relevant Material:

  1. Analyzing Algorithms
  2. Asymptotic Notation (О, Ω, Θ, ο)
  3. Heaps
    • Min-heap property, heap definition
    • Using array implementation, findMin takes O(1) time, and extractMin and insert take O(log n) time
    • Heapsort: Repeatedly extract min in min-heap; O(n log n) time
  4. Red black trees:
    • Properties of Binary Search Trees
    • Properties of Red black trees
      •  If black-height is b and the height of the tree is h, then b<=h<=2b
        • h = b when all the nodes in the tree are black
        • h=2b when you have red and black nodes in alternating levels
    • Sample Questions:
      • Justify whether a given tree is a legal red black tree / binary tree / balanced search tree
      • Rotations in binary trees (not necessarily red-black trees)
      • No insertion
      • Maximum and minimum number of elements in a red black tree with black height b
  5. B-Trees:
    • A B-tree with minimum dregree k >= 2 has following properties
      • Number of keys in root: 1<= #keys <= 2k-1
      • Number of keys in other nodes: k-1 <=  #keys <= 2k-1
      • Each node will have exactly #keys stored in that node + 1 number of children
      • All leaves will be in the same level
      • Only a root split can increase the height of a B-tree
    • Sample Questions:
      1. For a given tree justify if it is a legal B-tree
      2. For a given set of numbers come up with all possible legal B-trees
      3. Maximum and minimum number of keys possible to store in a B-tree
      4. Insertion in a B-tree (show node split if needed; remember to pre-emptively split on the way down to a leaf when inserting a node)
  6. Recursion:
  7. Recursion Tree: Find a guess what a (runtime) recurrence could solve to using the recursion tree method
  8. Solving Recurrences: Solve a runtime recurrence (i.e., find an upper bound for a recursively defined T(n)):
  9. Dynamic Programming (DP):
  10. Greedy Algorithms
    • Greedy Strategies:
      • repeatedly identify the decision to be made (recursion)
      • make a locally optimal choice for each decision
    • Greedy does not always work.

Practice Problems from the Book: