# CS61B Textbook

## CS61B Textbook 2023

- [Contributors](https://cs61b-2.gitbook.io/cs61b-textbook/contributors.md): 61B Course Staff who helped contribute to this amazing 61Book!
- [DISCLAIMER](https://cs61b-2.gitbook.io/cs61b-textbook/disclaimer.md)
- [1. Introduction](https://cs61b-2.gitbook.io/cs61b-textbook/1.-introduction.md)
- [1.1 Your First Java Program](https://cs61b-2.gitbook.io/cs61b-textbook/1.-introduction/1.1-your-first-java-program.md)
- [1.2 Java Workflow](https://cs61b-2.gitbook.io/cs61b-textbook/1.-introduction/1.2-java-workflow.md)
- [1.3 Basic Java Features](https://cs61b-2.gitbook.io/cs61b-textbook/1.-introduction/1.3-basic-java-features.md)
- [1.4 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/1.-introduction/1.4-exercises.md)
- [2. Defining and Using Classes](https://cs61b-2.gitbook.io/cs61b-textbook/2.-defining-and-using-classes.md)
- [3. References, Recursion, and Lists](https://cs61b-2.gitbook.io/cs61b-textbook/3.-references-recursion-and-lists.md)
- [4. SLLists](https://cs61b-2.gitbook.io/cs61b-textbook/4.-sllists.md)
- [5. DLLists](https://cs61b-2.gitbook.io/cs61b-textbook/5.-dllists.md)
- [6. Arrays](https://cs61b-2.gitbook.io/cs61b-textbook/6.-arrays.md)
- [7. Testing](https://cs61b-2.gitbook.io/cs61b-textbook/7.-testing.md)
- [8. ArrayList](https://cs61b-2.gitbook.io/cs61b-textbook/8.-arraylist.md)
- [9. Inheritance I: Interface and Implementation Inheritance](https://cs61b-2.gitbook.io/cs61b-textbook/9.-inheritance-i-interface-and-implementation-inheritance.md)
- [10. Inheritance II: Extends, Casting, Higher Order Functions](https://cs61b-2.gitbook.io/cs61b-textbook/10.-inheritance-ii-extends-casting-higher-order-functions.md): By Vanessa Teo
- [10.1 Implementation Inheritance: Extends](https://cs61b-2.gitbook.io/cs61b-textbook/10.-inheritance-ii-extends-casting-higher-order-functions/10.1-implementation-inheritance-extends.md)
- [10.2 Encapsulation](https://cs61b-2.gitbook.io/cs61b-textbook/10.-inheritance-ii-extends-casting-higher-order-functions/10.2-encapsulation.md)
- [10.3 Casting](https://cs61b-2.gitbook.io/cs61b-textbook/10.-inheritance-ii-extends-casting-higher-order-functions/10.3-casting.md)
- [10.4 Higher Order Functions in Java](https://cs61b-2.gitbook.io/cs61b-textbook/10.-inheritance-ii-extends-casting-higher-order-functions/10.4-higher-order-functions-in-java.md)
- [10.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/10.-inheritance-ii-extends-casting-higher-order-functions/10.5-exercises.md)
- [11. Inheritance III: Subtype Polymorphism, Comparators, Comparable](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable.md)
- [11.1 A Review of Dynamic Method Selection](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable/11.1-a-review-of-dynamic-method-selection.md)
- [11.2 Subtype Polymorphism vs Explicit Higher Order Functions](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable/11.2-subtype-polymorphism-vs-explicit-higher-order-functions.md)
- [11.3 Comparables](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable/11.3-comparables.md): One Sizable Application of Subtype Polymorphism
- [11.4 Comparators](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable/11.4-comparators.md)
- [11.5 Chapter Summary](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable/11.5-chapter-summary.md)
- [11.6 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/11.-inheritance-iii-subtype-polymorphism-comparators-comparable/11.6-exercises.md)
- [12. Inheritance IV: Iterators, Object Methods](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods.md)
- [12.1 Lists and Sets in Java](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods/12.1-lists-and-sets-in-java.md)
- [12.2 Exceptions](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods/12.2-exceptions.md)
- [12.3 Iteration](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods/12.3-iteration.md)
- [12.4 Object Methods](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods/12.4-object-methods.md)
- [12.5 Chapter Summary](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods/12.5-chapter-summary.md): Summary of the main points in this chapter.
- [12.6 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/12.-inheritance-iv-iterators-object-methods/12.6-exercises.md)
- [13. Asymptotics I](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i.md): By: Thomas Lee
- [13.1 An Introduction to Asymptotic Analysis](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.1-an-introduction-to-asymptotic-analysis.md): We always have to start somewhere.
- [13.2 Runtime Characterization](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.2-runtime-characterization.md): Techniques for Measuring Computational Cost.
- [13.3 Checkpoint: An Exercise](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.3-checkpoint-an-exercise.md): Some much needed practice.
- [13.4 Asymptotic Behavior](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.4-asymptotic-behavior.md): Be on your best behavior!
- [13.6 Simplified Analysis Process](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.6-simplified-analysis-process.md): It's not that simple.
- [13.7 Big-Theta](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.7-big-theta.md): Not to be confused with Big-O.
- [13.8 Big-O](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.8-big-o.md): Not to be confused with Big-Theta.
- [13.9 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.9-summary.md)
- [13.10 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/13.-asymptotics-i/13.10-exercises.md)
- [14. Disjoint Sets](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets.md): By Dhruti Pandya and Mihir Mirchandani
- [14.1 Introduction](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets/14.1-introduction.md): 🚨 New Data Structure Alert 🚨: Disjoint Sets
- [14.2 Quick Find](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets/14.2-quick-find.md): Keeping track of set membership...
- [14.3 Quick Union](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets/14.3-quick-union.md)
- [14.4 Weighted Quick Union (WQU)](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets/14.4-weighted-quick-union-wqu.md)
- [14.5 Weighted Quick Union with Path Compression](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets/14.5-weighted-quick-union-with-path-compression.md): Weighted Quick Union is pretty good, but we can do even better!
- [14.6 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/14.-disjoint-sets/14.6-exercises.md)
- [15. Asymptotics II](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii.md): There's no magic shortcut.
- [15.1 For Loops](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii/15.1-for-loops.md): Count, count, count...
- [15.2 Recursion](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii/15.2-recursion.md): Here we go again...
- [15.3 Binary Search](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii/15.3-binary-search.md): hi-lo!
- [15.4 Mergesort](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii/15.4-mergesort.md)
- [15.5 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii/15.5-summary.md): Wrapping up our asymptotics adventures.
- [15.6 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/15.-asymptotics-ii/15.6-exercises.md): Doing more practices is the best way to gain intuition when it comes to asymptotics!
- [16. ADTs and BSTs](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts.md)
- [16.1 Abstract Data Types](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.1-abstract-data-types.md)
- [16.2 Binary Search Trees](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.2-binary-search-trees.md)
- [16.3 BST Definitions](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.3-bst-definitions.md)
- [16.4 BST Operations](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.4-bst-operations.md)
- [16.5 BSTs as Sets and Maps](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.5-bsts-as-sets-and-maps.md)
- [16.6 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.6-summary.md)
- [16.7 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/16.-adts-and-bsts/16.7-exercises.md)
- [17. B-Trees](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees.md)
- [17.1 BST Performance](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.1-bst-performance.md)
- [17.2 Big O vs. Worst Case](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.2-big-o-vs.-worst-case.md): A short digression on asymptotics
- [17.3 B-Tree Operations](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.3-b-tree-operations.md)
- [17.4 B-Tree Invariants](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.4-b-tree-invariants.md)
- [17.5 B-Tree Performance](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.5-b-tree-performance.md)
- [17.6 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.6-summary.md)
- [17.7 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/17.-b-trees/17.7-exercises.md)
- [18. Red Black Trees](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees.md): Time for some colors.
- [18.1 Rotating Trees](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees/18.1-rotating-trees.md): Just like Ferris Wheels.
- [18.2 Creating LLRB Trees](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees/18.2-creating-llrb-trees.md): Software Engineers? More like Tree Engineers
- [18.3 Inserting LLRB Trees](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees/18.3-inserting-llrb-trees.md): Some Tree Maintenance.
- [18.4 Runtime Analysis](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees/18.4-runtime-analysis.md): Short and Sweet.
- [18.5 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees/18.5-summary.md)
- [18.6 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/18.-red-black-trees/18.6-exercises.md)
- [19. Hashing I](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i.md): By William Lee and Angel Aldaco
- [19.1 Introduction to Hashing: Data Indexed Arrays](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.1-introduction-to-hashing-data-indexed-arrays.md)
- [19.1.1 A first attempt: DataIndexedIntegerSet](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.1-introduction-to-hashing-data-indexed-arrays/19.1.1-a-first-attempt-dataindexedintegerset.md)
- [19.1.2 A second attempt: DataIndexedWordSet](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.1-introduction-to-hashing-data-indexed-arrays/19.1.2-a-second-attempt-dataindexedwordset.md)
- [19.1.3 A third attempt: DataIndexedStringSet](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.1-introduction-to-hashing-data-indexed-arrays/19.1.3-a-third-attempt-dataindexedstringset.md)
- [19.2 Hash Code](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.2-hash-code.md): The core mechanism of hashing!
- [19.3 "Valid" & "Good" Hashcodes](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.3-valid-and-good-hashcodes.md)
- [19.4 Handling Collisions: Linear Probing and External Chaining](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.4-handling-collisions-linear-probing-and-external-chaining.md)
- [19.5 Resizing & Hash Table Performance](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.5-resizing-and-hash-table-performance.md)
- [19.6 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.6-summary.md)
- [19.7 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/19.-hashing-i/19.7-exercises.md)
- [20. Hashing II](https://cs61b-2.gitbook.io/cs61b-textbook/20.-hashing-ii.md): By Mihir Mirchandani and William Lee
- [20.1 Hash Table Recap, Default Hash Function](https://cs61b-2.gitbook.io/cs61b-textbook/20.-hashing-ii/20.1-hash-table-recap-default-hash-function.md): "The whole point is that we have a bunch of lists that are all short." - Professor Hug.
- [20.2 Distribution By Other Hash Functions](https://cs61b-2.gitbook.io/cs61b-textbook/20.-hashing-ii/20.2-distribution-by-other-hash-functions.md): HashMaps/Tables have fast lookup times, but behind that "superpower" is a hash function.
- [20.3 Contains & Duplicate Items](https://cs61b-2.gitbook.io/cs61b-textbook/20.-hashing-ii/20.3-contains-and-duplicate-items.md)
- [20.4 Mutable vs. Immutable Types](https://cs61b-2.gitbook.io/cs61b-textbook/20.-hashing-ii/20.4-mutable-vs.-immutable-types.md)
- [21. Heaps and Priority Queues](https://cs61b-2.gitbook.io/cs61b-textbook/21.-heaps-and-priority-queues.md): By Dhruti Pandya and Angel Aldaco
- [21.1 Priority Queues](https://cs61b-2.gitbook.io/cs61b-textbook/21.-heaps-and-priority-queues/21.1-priority-queues.md)
- [21.2 Heaps](https://cs61b-2.gitbook.io/cs61b-textbook/21.-heaps-and-priority-queues/21.2-heaps.md)
- [21.3 PQ Implementation](https://cs61b-2.gitbook.io/cs61b-textbook/21.-heaps-and-priority-queues/21.3-pq-implementation.md)
- [21.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/21.-heaps-and-priority-queues/21.4-summary.md)
- [21.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/21.-heaps-and-priority-queues/21.5-exercises.md)
- [22. Tree Traversals and Graphs](https://cs61b-2.gitbook.io/cs61b-textbook/22.-tree-traversals-and-graphs.md): By Mihir Mirchandani and Dhruti Pandya
- [22.1 Tree Recap](https://cs61b-2.gitbook.io/cs61b-textbook/22.-tree-traversals-and-graphs/22.1-tree-recap.md)
- [22.2 Tree Traversals](https://cs61b-2.gitbook.io/cs61b-textbook/22.-tree-traversals-and-graphs/22.2-tree-traversals.md)
- [22.3 Graphs](https://cs61b-2.gitbook.io/cs61b-textbook/22.-tree-traversals-and-graphs/22.3-graphs.md)
- [22.4 Graph Problems](https://cs61b-2.gitbook.io/cs61b-textbook/22.-tree-traversals-and-graphs/22.4-graph-problems.md)
- [23. Graph Traversals and Implementations](https://cs61b-2.gitbook.io/cs61b-textbook/23.-graph-traversals-and-implementations.md): By William Lee and Mihir Mirchandani
- [23.1 BFS & DFS](https://cs61b-2.gitbook.io/cs61b-textbook/23.-graph-traversals-and-implementations/23.1-bfs-and-dfs.md)
- [23.2 Representing Graphs](https://cs61b-2.gitbook.io/cs61b-textbook/23.-graph-traversals-and-implementations/23.2-representing-graphs.md): How do we create a graph in Java?
- [23.3 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/23.-graph-traversals-and-implementations/23.3-summary.md)
- [23.4 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/23.-graph-traversals-and-implementations/23.4-exercises.md)
- [24. Shortest Paths](https://cs61b-2.gitbook.io/cs61b-textbook/24.-shortest-paths.md): By: Mihir Mirchandani and Teresa Luo
- [24.1 Introduction](https://cs61b-2.gitbook.io/cs61b-textbook/24.-shortest-paths/24.1-introduction.md)
- [24.2 Dijkstra's Algorithm](https://cs61b-2.gitbook.io/cs61b-textbook/24.-shortest-paths/24.2-dijkstras-algorithm.md)
- [24.3 A\* Algorithm](https://cs61b-2.gitbook.io/cs61b-textbook/24.-shortest-paths/24.3-a-algorithm.md)
- [24.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/24.-shortest-paths/24.4-summary.md)
- [24.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/24.-shortest-paths/24.5-exercises.md)
- [25. Minimum Spanning Trees](https://cs61b-2.gitbook.io/cs61b-textbook/25.-minimum-spanning-trees.md): By Teresa Luo and Mihir Mirchandani
- [25.1 MSTs and Cut Property](https://cs61b-2.gitbook.io/cs61b-textbook/25.-minimum-spanning-trees/25.1-msts-and-cut-property.md)
- [25.2 Prim's Algorithm](https://cs61b-2.gitbook.io/cs61b-textbook/25.-minimum-spanning-trees/25.2-prims-algorithm.md): Finding MST.
- [25.3 Kruskal's Algorithm](https://cs61b-2.gitbook.io/cs61b-textbook/25.-minimum-spanning-trees/25.3-kruskals-algorithm.md): Finding MST.
- [25.4 Chapter Summary](https://cs61b-2.gitbook.io/cs61b-textbook/25.-minimum-spanning-trees/25.4-chapter-summary.md)
- [25.5 MST Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/25.-minimum-spanning-trees/25.5-mst-exercises.md)
- [26. Prefix Operations and Tries](https://cs61b-2.gitbook.io/cs61b-textbook/26.-prefix-operations-and-tries.md): By: Thomas Lee
- [26.1 Introduction to Tries](https://cs61b-2.gitbook.io/cs61b-textbook/26.-prefix-operations-and-tries/26.1-introduction-to-tries.md): Do or do not. There is no Trie.
- [26.2 Trie Implementation](https://cs61b-2.gitbook.io/cs61b-textbook/26.-prefix-operations-and-tries/26.2-trie-implementation.md): Giving it the old college Trie.
- [26.3 Trie String Operations](https://cs61b-2.gitbook.io/cs61b-textbook/26.-prefix-operations-and-tries/26.3-trie-string-operations.md): Trie, Trie again.
- [26.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/26.-prefix-operations-and-tries/26.4-summary.md)
- [26.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/26.-prefix-operations-and-tries/26.5-exercises.md)
- [27. Software Engineering I](https://cs61b-2.gitbook.io/cs61b-textbook/27.-software-engineering-i.md): By Aniruth Narayanan
- [27.1 Introduction to Software Engineering](https://cs61b-2.gitbook.io/cs61b-textbook/27.-software-engineering-i/27.1-introduction-to-software-engineering.md)
- [27.2 Complexity](https://cs61b-2.gitbook.io/cs61b-textbook/27.-software-engineering-i/27.2-complexity.md)
- [27.3 Strategic vs Tactical Programming](https://cs61b-2.gitbook.io/cs61b-textbook/27.-software-engineering-i/27.3-strategic-vs-tactical-programming.md)
- [27.4 Real World Examples](https://cs61b-2.gitbook.io/cs61b-textbook/27.-software-engineering-i/27.4-real-world-examples.md)
- [27.5 Summary, Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/27.-software-engineering-i/27.5-summary-exercises.md)
- [28. Reductions and Decomposition](https://cs61b-2.gitbook.io/cs61b-textbook/28.-reductions-and-decomposition.md): By Mihir Mirchandani
- [28.1 Topological Sorts and DAGs](https://cs61b-2.gitbook.io/cs61b-textbook/28.-reductions-and-decomposition/28.1-topological-sorts-and-dags.md)
- [28.2 Shortest Paths on DAGs](https://cs61b-2.gitbook.io/cs61b-textbook/28.-reductions-and-decomposition/28.2-shortest-paths-on-dags.md)
- [28.3 Longest Path](https://cs61b-2.gitbook.io/cs61b-textbook/28.-reductions-and-decomposition/28.3-longest-path.md)
- [28.4 Reductions and Decomposition](https://cs61b-2.gitbook.io/cs61b-textbook/28.-reductions-and-decomposition/28.4-reductions-and-decomposition.md)
- [28.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/28.-reductions-and-decomposition/28.5-exercises.md)
- [29. Basic Sorts](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts.md)
- [29.1 The Sorting Problem](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts/29.1-the-sorting-problem.md)
- [29.2 Selection Sort & Heapsort](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts/29.2-selection-sort-and-heapsort.md)
- [29.3 Mergesort](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts/29.3-mergesort.md)
- [29.4 Insertion Sort](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts/29.4-insertion-sort.md)
- [29.5 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts/29.5-summary.md)
- [29.6 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/29.-basic-sorts/29.6-exercises.md)
- [30. Quicksort](https://cs61b-2.gitbook.io/cs61b-textbook/30.-quicksort.md)
- [30.1 Partitioning](https://cs61b-2.gitbook.io/cs61b-textbook/30.-quicksort/30.1-partitioning.md)
- [30.2 Quicksort Algorithm](https://cs61b-2.gitbook.io/cs61b-textbook/30.-quicksort/30.2-quicksort-algorithm.md)
- [30.3 Quicksort Performance Caveats](https://cs61b-2.gitbook.io/cs61b-textbook/30.-quicksort/30.3-quicksort-performance-caveats.md)
- [30.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/30.-quicksort/30.4-summary.md)
- [30.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/30.-quicksort/30.5-exercises.md)
- [31. Software Engineering II](https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii.md): By Thomas Lee and Mihir Mirchandani
- [31.1 Complexity II](https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii/31.1-complexity-ii.md): Complexity comshmexity.
- [31.2 Sources of Complexity](https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii/31.2-sources-of-complexity.md)
- [31.3 Modular Design](https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii/31.3-modular-design.md): A tool for managing complexity.
- [31.4 Teamwork](https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii/31.4-teamwork.md): "There is no I in TEAM"
- [31.5 Exerises](https://cs61b-2.gitbook.io/cs61b-textbook/31.-software-engineering-ii/31.5-exerises.md)
- [32. More Quick Sort, Sorting Summary](https://cs61b-2.gitbook.io/cs61b-textbook/32.-more-quick-sort-sorting-summary.md): By Teresa Luo and Nathalys Pham
- [32.1 Quicksort Flavors vs. MergeSort](https://cs61b-2.gitbook.io/cs61b-textbook/32.-more-quick-sort-sorting-summary/32.1-quicksort-flavors-vs.-mergesort.md)
- [32.2 Quick Select](https://cs61b-2.gitbook.io/cs61b-textbook/32.-more-quick-sort-sorting-summary/32.2-quick-select.md)
- [32.3 Stability, Adaptiveness, and Optimization](https://cs61b-2.gitbook.io/cs61b-textbook/32.-more-quick-sort-sorting-summary/32.3-stability-adaptiveness-and-optimization.md)
- [32.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/32.-more-quick-sort-sorting-summary/32.4-summary.md)
- [32.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/32.-more-quick-sort-sorting-summary/32.5-exercises.md)
- [33. Software Engineering III](https://cs61b-2.gitbook.io/cs61b-textbook/33.-software-engineering-iii.md): By William Lee and Teresa Luo
- [33.1 Candy Crush, SnapChat, and Friends](https://cs61b-2.gitbook.io/cs61b-textbook/33.-software-engineering-iii/33.1-candy-crush-snapchat-and-friends.md)
- [33.2 The Ledger of Harms](https://cs61b-2.gitbook.io/cs61b-textbook/33.-software-engineering-iii/33.2-the-ledger-of-harms.md)
- [33.3 Your Life](https://cs61b-2.gitbook.io/cs61b-textbook/33.-software-engineering-iii/33.3-your-life.md)
- [33.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/33.-software-engineering-iii/33.4-summary.md)
- [33.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/33.-software-engineering-iii/33.5-exercises.md)
- [34. Sorting  and Algorithmic Bounds](https://cs61b-2.gitbook.io/cs61b-textbook/34.-sorting-and-algorithmic-bounds.md): By William Lee and Angel Aldaco
- [34.1 Sorting Summary](https://cs61b-2.gitbook.io/cs61b-textbook/34.-sorting-and-algorithmic-bounds/34.1-sorting-summary.md)
- [34.2 Math Problems Out of Nowhere](https://cs61b-2.gitbook.io/cs61b-textbook/34.-sorting-and-algorithmic-bounds/34.2-math-problems-out-of-nowhere.md)
- [34.3 Theoretical Bounds on Sorting](https://cs61b-2.gitbook.io/cs61b-textbook/34.-sorting-and-algorithmic-bounds/34.3-theoretical-bounds-on-sorting.md): What is the best time we can get for sorting?
- [34.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/34.-sorting-and-algorithmic-bounds/34.4-summary.md)
- [34.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/34.-sorting-and-algorithmic-bounds/34.5-exercises.md)
- [35. Radix Sorts](https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts.md): By Mihir Mirchandani
- [35.1 Counting Sort](https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts/35.1-counting-sort.md)
- [35.2 LSD Radix Sort](https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts/35.2-lsd-radix-sort.md)
- [35.3 MSD Radix Sort](https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts/35.3-msd-radix-sort.md): Basic idea: Just like LSD, but sort from leftmost digit towards the right.
- [35.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts/35.4-summary.md)
- [35.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/35.-radix-sorts/35.5-exercises.md)
- [36. Sorting and Data Structures Conclusion](https://cs61b-2.gitbook.io/cs61b-textbook/36.-sorting-and-data-structures-conclusion.md): By Mihir Mirchandani and William Lee
- [36.1 Radix vs. Comparison Sorting](https://cs61b-2.gitbook.io/cs61b-textbook/36.-sorting-and-data-structures-conclusion/36.1-radix-vs.-comparison-sorting.md)
- [36.2 The Just-In-Time Compiler](https://cs61b-2.gitbook.io/cs61b-textbook/36.-sorting-and-data-structures-conclusion/36.2-the-just-in-time-compiler.md)
- [36.3 Radix Sorting Integers](https://cs61b-2.gitbook.io/cs61b-textbook/36.-sorting-and-data-structures-conclusion/36.3-radix-sorting-integers.md): ft. Obama
- [36.4 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/36.-sorting-and-data-structures-conclusion/36.4-summary.md)
- [36.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/36.-sorting-and-data-structures-conclusion/36.5-exercises.md)
- [37. Software Engineering IV](https://cs61b-2.gitbook.io/cs61b-textbook/37.-software-engineering-iv.md): By Mihir Mirchandani
- [37.1 The end is near](https://cs61b-2.gitbook.io/cs61b-textbook/37.-software-engineering-iv/37.1-the-end-is-near.md)
- [38. Compression and Complexity](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity.md): By Dhruti Pandya and Stella Kaval
- [38.1 Introduction to Compression](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.1-introduction-to-compression.md)
- [38.2 Prefix-free Codes](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.2-prefix-free-codes.md)
- [38.3 Shannon-Fano Codes](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.3-shannon-fano-codes.md)
- [38.4 Huffman Coding Conceptuals](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.4-huffman-coding-conceptuals.md)
- [38.5 Compression Theory](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.5-compression-theory.md)
- [38.6 LZW Compression](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.6-lzw-compression.md)
- [38.7 Summary](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.7-summary.md)
- [38.8 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/38.-compression-and-complexity/38.8-exercises.md)
- [39. Compression, Complexity, P = NP](https://cs61b-2.gitbook.io/cs61b-textbook/39.-compression-complexity-p-np.md)
- [39.1 Models of Compression](https://cs61b-2.gitbook.io/cs61b-textbook/39.-compression-complexity-p-np/39.1-models-of-compression.md)
- [39.2 Optimal Compression, Kolmogorov Complexity](https://cs61b-2.gitbook.io/cs61b-textbook/39.-compression-complexity-p-np/39.2-optimal-compression-kolmogorov-complexity.md)
- [39.3 Space/Time-Bounded Compression](https://cs61b-2.gitbook.io/cs61b-textbook/39.-compression-complexity-p-np/39.3-space-time-bounded-compression.md)
- [39.4 P = NP](https://cs61b-2.gitbook.io/cs61b-textbook/39.-compression-complexity-p-np/39.4-p-np.md)
- [39.5 Exercises](https://cs61b-2.gitbook.io/cs61b-textbook/39.-compression-complexity-p-np/39.5-exercises.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on a page URL with the `ask` query parameter:
```
GET https://cs61b-2.gitbook.io/cs61b-textbook/contributors.md?ask=<question>
```
The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.
Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
