Chapter 0 Preface¶
Chapter 1 Introduction¶
Chapter 2 Mathematical Background¶
Chapter 3 Searching¶
Chapter 4 Algorithm Analysis¶
- 4.1. Chapter Introduction
- 4.2. Problems, Algorithms, and Programs
- 4.3. Comparing Algorithms
- 4.4. Best, Worst, and Average Cases
- 4.5. Faster Computer, or Faster Algorithm?
- 4.6. Asymptotic Analysis and Upper Bounds
- 4.7. Lower Bounds and \(\Theta\) Notation
- 4.8. Calculating Program Running Time
- 4.9. Analyzing Problems
- 4.10. Common Misunderstandings
- 4.11. Multiple Parameters
- 4.12. Space Bounds
- 4.13. Code Tuning and Empirical Analysis
Chapter 5 Linear Structures¶
- 5.1. Chapter Introduction: Lists
- 5.2. The List ADT
- 5.3. Array-Based List Implementation
- 5.4. Linked Lists
- 5.5. Comparison of List Implementations
- 5.6. Doubly Linked Lists
- 5.7. List Element Implementations
- 5.8. Stacks
- 5.9. Linked Stacks
- 5.10. Freelists
- 5.11. Implementing Recursion
- 5.12. Queues
- 5.13. Linked Queues
- 5.14. Linear Structure 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 Design¶
Chapter 8 Binary Trees¶
- 8.1. Binary Trees Chapter Introduction
- 8.2. Binary Trees
- 8.3. Binary Tree as a Recursive Data Structure
- 8.4. The Full Binary Tree Theorem
- 8.5. Binary Tree Traversals
- 8.6. Implementing Tree Traversals
- 8.7. Information Flow in Recursive Functions
- 8.7.1. Information Flow in Recursive Functions
- 8.7.2. Binary Tree Set Depth Exercise
- 8.7.3. Collect-and-return
- 8.7.4. Binary Tree Check Sum Exercise
- 8.7.5. Binary Tree Leaf Nodes Count Exercise
- 8.7.6. Binary Tree Sum Nodes Exercise
- 8.7.7. Combining Information Flows
- 8.7.8. Binary Tree Check Value Exercise
- 8.7.9. Combination Problems
- 8.7.10. Binary Tree Height Exercise
- 8.7.11. Binary Tree Get Difference Exercise
- 8.7.12. Binary Tree Has Path Sum Exercise
- 8.8. Binary Tree Node Implementations
- 8.9. Composite-based Expression Tree
- 8.10. Binary Tree Space Requirements
- 8.11. Binary Search Trees
- 8.12. Dictionary Implementation Using a BST
- 8.13. Binary Tree Guided Information Flow
- 8.14. Multiple Binary Trees
- 8.15. A Hard Information Flow Problem
- 8.16. Array Implementation for Complete Binary Trees
- 8.17. Heaps and Priority Queues
- 8.18. Huffman Coding Trees
- 8.19. Trees versus Tries
- 8.20. Proof of Optimality for Huffman Coding
- 8.21. Binary Tree Chapter Summary
Chapter 9 Sorting¶
- 9.1. Chapter Introduction: Sorting
- 9.2. Sorting Terminology and Notation
- 9.3. Insertion Sort
- 9.4. Bubble Sort
- 9.5. Selection Sort
- 9.6. The Cost of Exchange Sorting
- 9.7. Optimizing Sort Algorithms with Code Tuning
- 9.8. Shellsort
- 9.9. Mergesort Concepts
- 9.10. Implementing Mergesort
- 9.11. Quicksort
- 9.12. Heapsort
- 9.13. Binsort
- 9.14. Radix Sort
- 9.15. An Empirical Comparison of Sorting Algorithms
- 9.16. Lower Bounds for Sorting
- 9.17. Sorting Summary Exercises