Chapter 0 Introduction¶
Chapter 1 Recursion¶
- 1.1. Introduction
- 1.2. Writing a recursive function
- 1.3. Code Completion Practice Exercises
- 1.3.1. Introduction
- 1.3.2. Recursion Programming Exercise: Largest
- 1.3.3. Recursion Programming Exercise: Multiply
- 1.3.4. Recursion Programming Exercise: GCD
- 1.3.5. Recursion Programming Exercise: log
- 1.3.6. Recursion Programming Exercise: Cummulative Sum
- 1.3.7. Recursion Programming Exercise: Add odd values
- 1.3.8. Recursion Programming Exercise: Sum Of the Digits
- 1.3.9. Recursion Programming Exercise: Count Characters
- 1.4. Writing More Sophisticated Recursive Functions
- 1.5. Harder Code Completion Practice Exercises
- 1.6. Writing Practice Exercises
- 1.7. Tracing Recursive Code
- 1.8. Tracing Practice Exercises
- 1.9. Summary Exercises
Chapter 2 Algorithm Analysis¶
- 2.1. Chapter Introduction
- 2.2. Problems, Algorithms, and Programs
- 2.3. Comparing Algorithms
- 2.4. Best, Worst, and Average Cases
- 2.5. Faster Computer, or Faster Algorithm?
- 2.6. Asymptotic Analysis and Upper Bounds
- 2.7. Lower Bounds and \(\Theta\) Notation
- 2.8. Calculating Program Running Time
- 2.9. Analyzing Problems
- 2.10. Recurrence Relations
- 2.11. Common Misunderstandings
- 2.12. Multiple Parameters
- 2.13. Space Bounds
- 2.14. Code Tuning and Empirical Analysis
- 2.15. Algorithm Analysis Summary Exercises
- 2.16. Algorithm Analysis Summary Exercises
Chapter 3 Linear Structures¶
- 3.1. Chapter Introduction: Lists
- 3.2. The List ADT
- 3.3. Array-Based List Implementation
- 3.4. Linked Lists
- 3.5. Comparison of List Implementations
- 3.6. Doubly Linked Lists
- 3.7. List Element Implementations
- 3.8. Stacks
- 3.9. Linked Stacks
- 3.10. Freelists
- 3.11. Implementing Recursion
- 3.12. Queues
- 3.13. Linked Queues
- 3.14. Linear Structure Summary Exercises
Chapter 4 Binary Trees¶
- 4.1. Binary Trees Chapter Introduction
- 4.2. Binary Trees
- 4.3. Binary Tree as a Recursive Data Structure
- 4.4. The Full Binary Tree Theorem
- 4.5. Binary Tree Traversals
- 4.6. Implementing Tree Traversals
- 4.7. Information Flow in Recursive Functions
- 4.7.1. Information Flow in Recursive Functions
- 4.7.2. Binary Tree Set Depth Exercise
- 4.7.3. Collect-and-return
- 4.7.4. Binary Tree Check Sum Exercise
- 4.7.5. Binary Tree Leaf Nodes Count Exercise
- 4.7.6. Binary Tree Sum Nodes Exercise
- 4.7.7. Combining Information Flows
- 4.7.8. Binary Tree Check Value Exercise
- 4.7.9. Combination Problems
- 4.7.10. Binary Tree Height Exercise
- 4.7.11. Binary Tree Get Difference Exercise
- 4.7.12. Binary Tree Has Path Sum Exercise
- 4.8. Binary Tree Node Implementations
- 4.9. Composite-based Expression Tree
- 4.10. Binary Tree Space Requirements
- 4.11. Binary Search Trees
- 4.12. Dictionary Implementation Using a BST
- 4.13. Binary Tree Guided Information Flow
- 4.14. Multiple Binary Trees
- 4.15. A Hard Information Flow Problem
- 4.16. Array Implementation for Complete Binary Trees
- 4.17. Heaps and Priority Queues
- 4.18. Huffman Coding Trees
- 4.19. Trees versus Tries
- 4.20. Proof of Optimality for Huffman Coding
- 4.21. Binary Tree Chapter Summary
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. Heapsort
- 5.13. Binsort
- 5.14. Radix Sort
- 5.15. An Empirical Comparison of Sorting Algorithms
- 5.16. Lower Bounds for Sorting
- 5.17. Sorting Summary Exercises
Chapter 6 Hashing¶
Chapter 7 Graphs¶
Chapter 8 Pointers¶
Chapter 9 Design I¶
Chapter 10 Design II¶
Chapter 11 Mathematical Background¶
Chapter 12 Searching I¶
Chapter 13 Indexing¶
Chapter 14 General Trees¶
Chapter 15 Searching¶
Chapter 16 Lower Bounds¶
Chapter 17 Number Problems¶
Chapter 18 Search Structures¶
Chapter 19 Miscellaneous¶
Chapter 20 Limits to Computing¶
- 20.1. Limits to Computing
- 20.2. Reductions
- 20.3. NP-Completeness
- 20.4. Circuit Satisfiability
- 20.5. Formula Satisfiability
- 20.6. 3-CNF Satisfiability
- 20.7. The Clique Problem
- 20.8. The Independent Set Problem
- 20.9. The Vertex Cover Problem
- 20.10. The Hamiltonian Cycle Problem
- 20.11. The Traveling Salesman Problem
- 20.12. NP-Completeness Proofs
- 20.13. Reduction of Circuit SAT to SAT
- 20.14. Reduction of SAT to 3-SAT
- 20.15. Reduction of 3-SAT to Clique
- 20.16. Reduction of Clique to Independent Set
- 20.17. Reduction of Independent Set to Vertex Cover
- 20.18. Reduction of 3-SAT to Hamiltonian Cycle
- 20.19. Reduction of Hamiltonian Cycle to Traveling Salesman
- 20.20. Coping with NP-Complete Problems
- 20.21. Unsolveable Problems
- 20.22. Turing Machines