Correct, then fast.

Say what the code guarantees. Then say how the cost grows.

These are the CS 3343 notes in the order the homework already uses. Read a page, step the picture, then try the question at the bottom. The long version, with the full practice exam and answer key, is a PDF on the Files page.

  1. CasesName the input that makes the algorithm kind, and the one you can actually promise.
  2. CountingCost times times. The while-test runs once more than the body.
  3. Bounds\(O\), \(\Omega\), \(\Theta\), and the strict cousins. Watch them pull apart.
  4. HoareA precondition, a line of code, a postcondition. Forward is strongest. Backward is weakest.
  5. InvariantsInit, maintenance, termination. The fact that is true every time you are at the top of the loop.
  6. SortsInsertion can stop early. Selection never does. They do not share an invariant.

When the notes feel solid, do the practice set with the answers covered. Lectures and the packet are under Watch and Files.