Skip to content

Algorithms

An algorithm is a finite, unambiguous procedure that transforms valid inputs into outputs satisfying a contract. This section combines implementation with correctness and resource analysis.

Topics

Evaluation checklist

For every algorithm, ask:

  1. What are its input model and preconditions?
  2. What does it guarantee on return?
  3. Why does it terminate and produce the correct result?
  4. What are its best, expected, amortized, and worst-case costs, where relevant?
  5. Is it stable, in-place, deterministic, online, or adaptive?
  6. Does an available library implementation provide a stronger contract?