Overview

This is the root index for the Algorithms area of the vault — foundational definitions and cost models that apply across every algorithm family below, plus links to each family’s own index.


Foundational Concepts

What is an Algorithm?

Definition A procedure for performing a computation, broken into well-specified steps.

  • Input: , an instance
  • Output: , a solution

Both and should be finitely describable.

A good algorithm must produce the correct answer, in a reasonable amount of time and space, using the least energy.

Hierarchy of Obviousness

  1. Obvious algorithms: implicit in the problem statement — brute force, exhaustive search.
  2. Methodical algorithms: applying general principles and paradigms that improve algorithms across a wide variety of problems (e.g. the design paradigms this vault is organized around).
  3. Clever algorithms: stretching those general paradigms in a way that best fits one particular problem — usually where the real insight and difficulty of a course lives.

Time for Arithmetic

The CPU is designed to process instructions on word-sized inputs.

  • Inputs less than word size: performed on the CPU in a single access.
  • Inputs greater than word size: must be broken down into word-sized chunks.
floating pointarbitrary
Addition
Subtraction
Comparison
Multiplication

Categories in This Vault

CategoryIndexOne-line description
Graph AlgorithmsGraph AlgorithmsTraversal (DFS/BFS), shortest paths (Dijkstra’s), and MSTs (Prim’s/Kruskal’s) — all specializations of the generic Graph Search procedure
Greedy AlgorithmsGreedy AlgorithmsLocally-optimal-choice algorithms, plus the three general techniques for proving one actually is optimal
Divide and ConquerDivide and ConquerBreak into smaller similar subproblems, solve recursively, combine — sorting, selection, and the Master Theorem that analyzes them all
Dynamic ProgrammingDynamic ProgrammingIdentify overlapping subproblems and solve smallest-first — often the fix for an exponential Backtracking algorithm
BacktrackingBacktrackingExhaustive search that prunes dead-end branches using the problem’s constraints — usually exponential, but much better than brute force
Linear ProgrammingLinear ProgrammingOptimization with linear constraints and objective — no local optima, global optimum always at a vertex of the feasible region

Related Notes

  • Levels of Algorithm Design — the High/Mid/Low-Level Design framework used throughout this vault’s individual algorithm notes.
  • Algorithm Base ― A structured, filterable, sortable database view over the algorithm notes