Chapter 0 Preface¶
Chapter 1 Introduction¶
Chapter 2 Mathematical Background¶
Chapter 3 Algorithm Analysis¶
- 3.1. Chapter Introduction
- 3.2. Problems, Algorithms, and Programs
- 3.3. Comparing Algorithms
- 3.4. Best, Worst, and Average Cases
- 3.5. Faster Computer, or Faster Algorithm?
- 3.6. Asymptotic Analysis and Upper Bounds
- 3.7. Lower Bounds and \(\Theta\) Notation
- 3.8. Calculating Program Running Time
- 3.9. Analyzing Problems
- 3.10. Common Misunderstandings
- 3.11. Multiple Parameters
- 3.12. Space Bounds
- 3.13. Code Tuning and Empirical Analysis
- 3.14. Algorithm Analysis Summary Exercises
- 3.15. Algorithm Analysis Summary Exercises
Chapter 4 Searching¶
Chapter 5 Sorting¶
- 5.1. Chapter Introduction: Sorting
- 5.2. Sorting Terminology and Notation
- 5.3. Insertion Sort
- 5.4. Bubble Sort
- 5.5. Selection Sort
- 5.6. The Cost of Exchange Sorting
- 5.7. Optimizing Sort Algorithms with Code Tuning
- 5.8. Shellsort
- 5.9. Mergesort Concepts
- 5.10. Implementing Mergesort
- 5.11. Quicksort
- 5.12. Quicksort
- 5.13. Heapsort
- 5.14. Binsort
- 5.15. Radix Sort
- 5.16. An Empirical Comparison of Sorting Algorithms
- 5.17. Lower Bounds for Sorting
- 5.18. Sorting Summary Exercises
Chapter 6 Recursion¶
- 6.1. Introduction
- 6.2. Writing a recursive function
- 6.3. Code Completion Practice Exercises
- 6.3.1. Introduction
- 6.3.2. Recursion Programming Exercise: Largest
- 6.3.3. Recursion Programming Exercise: Multiply
- 6.3.4. Recursion Programming Exercise: GCD
- 6.3.5. Recursion Programming Exercise: log
- 6.3.6. Recursion Programming Exercise: Cummulative Sum
- 6.3.7. Recursion Programming Exercise: Add odd values
- 6.3.8. Recursion Programming Exercise: Sum Of the Digits
- 6.3.9. Recursion Programming Exercise: Count Characters
- 6.4. Writing More Sophisticated Recursive Functions
- 6.5. Harder Code Completion Practice Exercises
- 6.6. Writing Practice Exercises
- 6.7. Tracing Recursive Code
- 6.8. Tracing Practice Exercises
- 6.9. Summary Exercises
Chapter 7 Graphs¶
Chapter 8 General Trees¶
Chapter 9 Binary Trees¶
- 9.1. Binary Trees Chapter Introduction
- 9.2. Binary Trees
- 9.3. Binary Tree as a Recursive Data Structure
- 9.4. The Full Binary Tree Theorem
- 9.5. Binary Tree Traversals
- 9.6. Implementing Tree Traversals
- 9.7. Information Flow in Recursive Functions
- 9.7.1. Information Flow in Recursive Functions
- 9.7.2. Binary Tree Set Depth Exercise
- 9.7.3. Collect-and-return
- 9.7.4. Binary Tree Check Sum Exercise
- 9.7.5. Binary Tree Leaf Nodes Count Exercise
- 9.7.6. Binary Tree Sum Nodes Exercise
- 9.7.7. Combining Information Flows
- 9.7.8. Binary Tree Check Value Exercise
- 9.7.9. Combination Problems
- 9.7.10. Binary Tree Height Exercise
- 9.7.11. Binary Tree Get Difference Exercise
- 9.7.12. Binary Tree Has Path Sum Exercise
- 9.8. Binary Tree Node Implementations
- 9.9. Composite-based Expression Tree
- 9.10. Binary Tree Space Requirements
- 9.11. Binary Search Trees
- 9.12. Dictionary Implementation Using a BST
- 9.13. Binary Tree Guided Information Flow
- 9.14. Multiple Binary Trees
- 9.15. A Hard Information Flow Problem
- 9.16. Array Implementation for Complete Binary Trees
- 9.17. Heaps and Priority Queues
- 9.18. Huffman Coding Trees
- 9.19. Trees versus Tries
- 9.20. Proof of Optimality for Huffman Coding
- 9.21. Binary Tree Chapter Summary
Chapter 10 Search Structures¶
Chapter 11 Hashing¶
Chapter 12 Advanced Analysis Techniques¶
Chapter 13 Advanced Algorithm Techniques¶
Chapter 14 Limits to Computing¶
- 14.1. Limits to Computing
- 14.2. Reductions
- 14.3. NP-Completeness
- 14.4. Circuit Satisfiability
- 14.5. Formula Satisfiability
- 14.6. 3-CNF Satisfiability
- 14.7. The Clique Problem
- 14.8. The Independent Set Problem
- 14.9. The Vertex Cover Problem
- 14.10. The Hamiltonian Cycle Problem
- 14.11. The Traveling Salesman Problem
- 14.12. NP-Completeness Proofs
- 14.13. Reduction of Circuit SAT to SAT
- 14.14. Reduction of SAT to 3-SAT
- 14.15. Reduction of 3-SAT to Clique
- 14.16. Reduction of Clique to Independent Set
- 14.17. Reduction of Independent Set to Vertex Cover
- 14.18. Reduction of 3-SAT to Hamiltonian Cycle
- 14.19. Reduction of Hamiltonian Cycle to Traveling Salesman
- 14.20. Coping with NP-Complete Problems
- 14.21. Unsolveable Problems
- 14.22. Turing Machines