Chapter 0 Lists¶
- 0.1. The List ADT
- 0.2. Array-Based List Implementation
- 0.3. Lists
- 0.3.1. Lists
- 0.3.1.1. Lists
- 0.3.1.2. List Implementation Concepts
- 0.3.1.3. List ADT (1)
- 0.3.1.4. List ADT (2)
- 0.3.1.5. List ADT (3)
- 0.3.1.6. List ADT Examples
- 0.3.1.7. List Find Function
- 0.3.1.8. Array-Based List Class (1)
- 0.3.1.9. Array-Based List Insert
- 0.3.1.10. Link Class
- 0.3.1.11. Linked List Position (1)
- 0.3.1.12. Linked List Position (2)
- 0.3.1.13. Linked List Position (3)
- 0.3.1.14. Linked List Class (1)
- 0.3.1.15. Linked List Class (2)
- 0.3.1.16. Insertion
- 0.3.1.17. Removal
- 0.3.1.18. Prev
- 0.3.1.19. Overhead
- 0.3.1.20. Comparison of Implementations
- 0.3.1.21. Space Comparison
- 0.3.1.22. Space Example
- 0.3.1.23. Freelist
- 0.3.1.24. Doubly Linked Lists
- 0.3.1.25. Doubly Linked Node (1)
- 0.3.1.26. Doubly Linked Insert
- 0.3.1.27. Doubly Linked Remove
- 0.3.1. Lists
Chapter 1 Linked Lists¶
Chapter 2 Algorithm Analysis¶
- 2.1. Problems, Algorithms, and Programs
- 2.2. Comparing Algorithms
- 2.3. Best, Worst, and Average Cases
- 2.4. Faster Computer, or Faster Algorithm?
- 2.5. Asymptotic Analysis and Upper Bounds
- 2.6. Calculating Program Running Time
- 2.7. Algorithm Analysis Summary Exercises
- 2.8. Algorithm Analysis
- 2.8.1. Algorithm Analysis
- 2.8.1.1. Algorithm Efficiency
- 2.8.1.2. How to Measure Efficiency?
- 2.8.1.3. Problems, Algorithms, Programs
- 2.8.1.4. Growth Rate Example (1)
- 2.8.1.5. Growth Rate Example (2)
- 2.8.1.6. Growth Rate Graph
- 2.8.1.7. Best, Worst, Average Cases
- 2.8.1.8. Which Analysis to Use?
- 2.8.1.9. Faster Computer or Algorithm?
- 2.8.1.10. Faster Computer or Algorithm? 2
- 2.8.1.11. Asymptotic Analysis: Big-oh
- 2.8.1.12. Big-oh Notation (cont)
- 2.8.1.13. Big-Oh Examples
- 2.8.1.14. Big-Oh Examples (2)
- 2.8.1.15. A Common Misunderstanding
- 2.8.1.16. Big-Omega Ω
- 2.8.1.17. Big-Omega Example
- 2.8.1.18. Theta Notation Θ
- 2.8.1.19. A Common Misunderstanding
- 2.8.1.20. Simplifying Rules
- 2.8.1.21. Summary
- 2.8.1.22. .
- 2.8.1.23. Time Complexity Examples (1)
- 2.8.1.24. Time Complexity Examples (2)
- 2.8.1.25. Time Complexity Examples (3)
- 2.8.1.26. Time Complexity Examples (4)
- 2.8.1.27. Binary Search
- 2.8.1.28. Other Control Statements
- 2.8.1.29. Analyzing Problems
- 2.8.1.30. Analyzing Problems: Example
- 2.8.1.31. Space/Time Tradeoff Principle
- 2.8.1.32. Multiple Parameters
- 2.8.1.33. Space Complexity
- 2.8.1. Algorithm Analysis
Chapter 3 Stacks¶
- 3.1. Stacks
- 3.2. Linked Stacks
- 3.3. Stacks and Queues
- 3.3.1. Container Class Design Issues
- 3.3.2. Stacks
- 3.3.3. Stack ADT
- 3.3.4. Array-Based Stack (1)
- 3.3.5. Array-Based Stack (2)
- 3.3.6. Linked Stack
- 3.3.7. Queues
- 3.3.8. Queue Implementation (1)
- 3.3.9. Queue Implementation (2)
- 3.3.10. Queue Implementation (3)
- 3.3.11. Circular Queue (1)
- 3.3.12. Circular Queue (2)
Chapter 4 Queues¶
Chapter 5 Searching¶
Chapter 6 Sorting¶
- 6.1. Chapter Introduction: Sorting
- 6.2. Sorting Terminology and Notation
- 6.3. Comparing Records
- 6.4. Insertion Sort
- 6.5. Bubble Sort
- 6.6. Selection Sort
- 6.7. Sorting Part 1
- 6.7.1. Sorting Part 1
- 6.7.1.1. Sorting
- 6.7.1.2. Insertion Sort
- 6.7.1.3. Initial Step
- 6.7.1.4. Analysis: Worst Case
- 6.7.1.5. Analysis: Best Case
- 6.7.1.6. Analysis: Average Case
- 6.7.1.7. Bubble Sort
- 6.7.1.8. Analysis
- 6.7.1.9. Selection Sort
- 6.7.1.10. Analysis
- 6.7.1.11. Summary
- 6.7.1.12. Code Tuning (1)
- 6.7.1.13. Exchange Sorting
- 6.7.1. Sorting Part 1
- 6.8. Sorting Part 2
- 6.8.1. Sorting Part 2
- 6.8.1.1. Shellsort
- 6.8.1.2. Shellsort (2)
- 6.8.1.3. Mergesort
- 6.8.1.4. .
- 6.8.1.5. Mergesort cost
- 6.8.1.6. Quicksort
- 6.8.1.7. Quicksort Partition
- 6.8.1.8. Quicksort Partition Cost
- 6.8.1.9. Quicksort Summary
- 6.8.1.10. Quicksort Worst Case
- 6.8.1.11. .
- 6.8.1.12. Quicksort Best Case
- 6.8.1.13. .
- 6.8.1.14. Quicksort Average Case
- 6.8.1.15. Optimizations for Quicksort
- 6.8.1.16. Heapsort
- 6.8.1.17. Heapsort Analysis
- 6.8.1.18. Binsort
- 6.8.1.19. Radix Sort: Linked List
- 6.8.1.20. .
- 6.8.1.21. Radix Sort: Array
- 6.8.1.22. Radix Sort Implementation
- 6.8.1.23. .
- 6.8.1.24. Radix Sort Analysis
- 6.8.1.25. Empirical Analysis
- 6.8.1.26. Sorting Lower Bound (1)
- 6.8.1.27. Sorting Lower Bound (2)
- 6.8.1. Sorting Part 2
Chapter 7 Binary Trees¶
- 7.1. Binary Trees Chapter Introduction
- 7.2. Binary Trees
- 7.3. Binary Tree as a Recursive Data Structure
- 7.4. The Full Binary Tree Theorem
- 7.5. Binary Tree Traversals
- 7.6. General Trees
- 7.7. Implementing Tree Traversals
- 7.8. Information Flow in Recursive Functions
- 7.8.1. Information Flow in Recursive Functions
- 7.8.2. Binary Tree Set Depth Exercise
- 7.8.3. Collect-and-return
- 7.8.4. Binary Tree Check Sum Exercise
- 7.8.5. Binary Tree Leaf Nodes Count Exercise
- 7.8.6. Binary Tree Sum Nodes Exercise
- 7.8.7. Combining Information Flows
- 7.8.8. Binary Tree Check Value Exercise
- 7.8.9. Combination Problems
- 7.8.10. Binary Tree Height Exercise
- 7.8.11. Binary Tree Get Difference Exercise
- 7.8.12. Binary Tree Has Path Sum Exercise
- 7.9. Binary Tree Node Implementations
- 7.10. Composite-based Expression Tree
- 7.11. Binary Tree Space Requirements
- 7.12. Binary Search Trees
- 7.13. Dictionary Implementation Using a BST
- 7.14. Binary Tree Guided Information Flow
- 7.15. Heaps and Priority Queues
- 7.16. Array Implementation for Complete Binary Trees
- 7.15. Heaps and Priority Queues
- 7.17. Binary Tree Chapter Summary
- 7.18. General Trees
- 7.18.1. General Trees
- 7.18.1.1. General Trees
- 7.18.1.2. General Tree ADT
- 7.18.1.3. General Tree Traversal
- 7.18.1.4. Rep: Lists of Children
- 7.18.1.5. Rep: Dynamic Node (Array)
- 7.18.1.6. Rep: Dynamic Node (linked list)
- 7.18.1.7. Rep: Left-Child/Right-Sibling
- 7.18.1.8. Serialization
- 7.18.1.9. Binary tree serialization
- 7.18.1.10. Alternate serialization
- 7.18.1.11. Bit Vector Serialization
- 7.18.1.12. General Tree Serialization
- 7.18.1. General Trees
Chapter 8 Hashing¶
- 8.1. Introduction
- 8.2. Hash Function Principles
- 8.3. Sample Hash Functions
- 8.4. Open Hashing
- 8.5. Bucket Hashing
- 8.6. Collision Resolution
- 8.7. Improved Collision Resolution
- 8.8. Analysis of Closed Hashing
- 8.9. Deletion
- 8.10. Hashing Chapter Summary Exercises
- 8.11. Hashing
- 8.11.1. Hashing
- 8.11.1.1. Hashing (1)
- 8.11.1.2. Hashing (2)
- 8.11.1.3. Simple Examples
- 8.11.1.4. Collisions (1)
- 8.11.1.5. Collisions (2)
- 8.11.1.6. Hash Functions (1)
- 8.11.1.7. Hash Functions (2)
- 8.11.1.8. Simple Mod Function
- 8.11.1.9. Binning
- 8.11.1.10. Mod vs. Binning
- 8.11.1.11. Mid-Square Method
- 8.11.1.12. Strings Function: Character Adding
- 8.11.1.13. String Folding
- 8.11.1.14. Open Hashing
- 8.11.1.15. Bucket Hashing (1)
- 8.11.1.16. Bucket Hashing (2)
- 8.11.1.17. Closed Hashing
- 8.11.1.18. Collision Resolution
- 8.11.1.19. Insertion
- 8.11.1.20. Search
- 8.11.1.21. Probe Function
- 8.11.1.22. Linear Probing (1)
- 8.11.1.23. Linear Probing (2)
- 8.11.1.24. Problem with Linear Probing
- 8.11.1.25. Linear Probing by Steps (1)
- 8.11.1.26. Linear Probing by Steps (2)
- 8.11.1.27. Pseudo-Random Probing (1)
- 8.11.1.28. Pseudo-Random Probing (2)
- 8.11.1.29. Quadratic Probing
- 8.11.1.30. Double Hashing (1)
- 8.11.1.31. Double Hashing (2)
- 8.11.1.32. Analysis of Closed Hashing
- 8.11.1.33. Deletion
- 8.11.1.34. Tombstones (1)
- 8.11.1.35. Tombstones (2)
- 8.11.1. Hashing
Chapter 9 Graphs¶
- 9.1. Graphs Chapter Introduction
- 9.2. Graph Traversals
- 9.3. Graph Implementations
- 9.4. Graph Concepts Summary
- 9.5. Kruskal’s Algorithm
- 9.6. All-Pairs Shortest Paths
- 9.7. Minimal Cost Spanning Trees
- 9.8. Shortest-Paths Problems
- 9.9. Topological Sort
- 9.10. Graphs
- 9.10.1. Graphs
- 9.10.1.1. Graphs
- 9.10.1.2. Paths, Cycles
- 9.10.1.3. Connected Components
- 9.10.1.4. Directed Graph Representation
- 9.10.1.5. Undirected Graph Representation
- 9.10.1.6. Representation Space Costs
- 9.10.1.7. Graph ADT
- 9.10.1.8. .
- 9.10.1.9. Visiting Neighbors
- 9.10.1.10. Graph Traversals
- 9.10.1.11. Graph Traversals (2)
- 9.10.1.12. Depth First Search (1)
- 9.10.1.13. Depth First Search (2)
- 9.10.1.14. Depth First Search (3)
- 9.10.1.15. Breadth First Search (1)
- 9.10.1.16. Breadth First Search (3)
- 9.10.1.17. Topological Sort
- 9.10.1.18. Depth-First Topological Sort (1)
- 9.10.1.19. Depth-First Topological Sort (1)
- 9.10.1.20. .
- 9.10.1.21. Queue-Based Topsort (1)
- 9.10.1.22. .
- 9.10.1.23. Queue-Based Topsort (2)
- 9.10.1.24. .
- 9.10.1.25. Shortest Paths Problems
- 9.10.1.26. Shortest Paths Definitions
- 9.10.1.27. Single-Source Shortest Paths
- 9.10.1.28. Dijkstra’s Algorithm Example
- 9.10.1.29. .
- 9.10.1.30. Dijkstra’s Implementation
- 9.10.1.31. Implementing minVertex
- 9.10.1.32. Approach 1
- 9.10.1.33. Approach 2
- 9.10.1.34. .
- 9.10.1.35. All-pairs Shortest Paths (1)
- 9.10.1.36. All-pairs Shortest Paths (2)
- 9.10.1.37. Floyd’s Algorithm
- 9.10.1.38. Minimal Cost Spanning Trees
- 9.10.1.39. MST Example
- 9.10.1.40. Prim’s MST Algorithm
- 9.10.1.41. .
- 9.10.1.42. Implementation 1
- 9.10.1.43. Alternate Implementation
- 9.10.1.44. Kruskal’s MST Algorithm (1)
- 9.10.1.45. Kruskal’s MST Algorithm (2)
- 9.10.1.46. .
- 9.10.1.47. Kruskal’s MST Algorithm (3)
- 9.10.1. Graphs