An algorithmic paradigm supplies the broad shape of a solution before implementation details take over. Merge sort divides and combines. Dijkstra commits greedily. Fibonacci with memoization stores repeated states. Recognizing that shape narrows both the implementation and the proof: a greedy choice needs an exchange argument, while an optimization DP needs optimal substructure.

Algorithm Selection

ParadigmStrategyDiagnostic / proof obligationClassic examples
Divide and ConquerSplit into disjoint subproblems, recurse, combineSeparable recursive subproblems and a combine operation. Combine cost affects performanceMerge Sort, Binary Search, Karatsuba, FFT
Dynamic ProgrammingReuse answers to overlapping subproblemsEnumerable state dependencies. Overlap makes reuse valuable. Optimization also needs optimal substructureKnapsack, edit distance, longest common subsequence
GreedyTake the locally optimal choice, never revisitGreedy-choice property with a problem-specific proof such as exchange, stays-ahead, or cut reasoningDijkstra, Huffman coding, interval scheduling
BacktrackingDFS over choices, prune dead branchesPartial solutions can be rejected earlyN-Queens, Sudoku, permutations/subsets
Branch and BoundDFS or best-first over choices, prune by optimistic boundAn admissible bound on the best achievable in a subtree0/1 knapsack, TSP, integer linear programming

TIP

If backtracking reaches the same subproblem repeatedly, adding memoisation turns the search into dynamic programming. If a local choice can be proved safe, a greedy algorithm may replace the DP with a cheaper scan.

The most useful distinctions are about repeated work and safe pruning. Divide-and-conquer and dynamic programming differ in whether their subproblems overlap. Memoization helps only when the same state returns. Backtracking and branch-and-bound justify pruning differently. Backtracking rejects an infeasible partial candidate, while branch-and-bound rejects a subtree whose optimistic bound cannot beat the current best solution. That optimism is the same admissibility condition that A* Search requires from its heuristic. Dynamic programming becomes the better fit when repeated subproblems let the search collapse into a manageable table.

They all contrast with patterns (two pointers, sliding window), which are concrete coding idioms rather than design philosophies.

References

6 items under this folder.