5.1 Algorithms5.1.1 More Pseudocode5.1.2 Preconditions and Postconditions5.1.3 Iterative Algorithms5.1.4 Functions and Recursive AlgorithmsExercises 5.15.2 Three Common Types of Algorithms5.2.1 Traversal Algorithms5.2.2 Greedy Algorithms5.2.3 Divide-and-Conquer AlgorithmsExercises 5.25.3 Algorithm Complexity5.3.1 The Good, the Bad, and the Average5.3.2 Approximate Complexity CalculationsExercises 5.35.4 Bounds on Complexity5.4.1 Algorithms as Decisions5.4.2 A Lower Bound5.4.3 Searching an Array5.4.4 Sorting5.4.5 P vs. NPExercises 5.45.5 Program Verification5.5.1 Verification vs. Testing5.5.2 Verifying Recursive Algorithms5.5.3 Searching and Sorting5.5.4 Towers of HanoiExercises 5.55.6 Loop Invariants5.6.1 Verifying Iterative Algorithms5.6.2 Searching and Sorting5.6.3 Using Invariants to Design AlgorithmsExercises 5.6