1. 3.1 Cache Replacement Policieshistorical

    Caches have limited space and must evict data when full. These notes compare how strategies such as FIFO and LRU choose what to retain or remove.

  2. 3.2 Dynamic Programminghistorical

    Dynamic programming can be derived from recursion and memoization. These notes use path-counting examples to explain states, transitions, and optimal substructure.

  3. 3.3 Greedyhistorical

    A greedy algorithm makes the best available choice at each step. These notes explore this approach through loading and coin-change problems.

  4. 3.4 Divide and Conquerhistorical

    Divide and conquer splits a problem into smaller problems of the same structure, solves them recursively, and combines their results.

  5. 3.5 Recursionhistorical

    Recursion lets a function call itself, breaking a problem into smaller cases until they can be solved directly and their results returned through the call chain.

  6. 3.6 Backtrackinghistorical

    Backtracking explores a choice, continues while it remains viable, and returns to try alternatives when it fails. These notes illustrate it with problems such as eight queens.

  7. 3.7 DFShistorical

    Depth-first search is commonly used for string, array, and tree problems, often together with backtracking. These notes explore it through permutation and combination examples.

  8. 3.8 Binary Searchhistorical

    Binary search compares a target with the middle element of a sorted array, then continues in the left or right half to narrow the search.

  9. 3.9 Bubble Sorthistorical

    Bubble sort repeatedly scans an array, comparing adjacent elements and swapping out-of-order pairs until the array is sorted.

  10. 3.10 Linear Searchhistorical

    Linear search compares array elements one by one, returning the target's index or -1 if it is absent. The notes include a Go implementation and test examples.

  11. 3.11 Heap Sorthistorical

    Heap sort builds a heap and repeatedly removes the root while restoring the heap structure. The notes include implementation, tests, and complexity analysis.

  12. 3.12 Merge Sorthistorical

    Merge sort repeatedly divides an array until each part is sorted, then merges the sorted parts to produce the final array.

  13. 3.13 Insertion Sorthistorical

    Insertion sort divides an array into sorted and unsorted parts, taking one element at a time and inserting it into the appropriate position in the sorted part.

  14. 3.14 Quick Sorthistorical

    Quicksort selects a pivot, moves smaller values to one side and larger values to the other, then repeats the process on each partition.

  15. 3.15 Selection Sorthistorical

    Selection sort finds the largest or smallest element on each pass and places it in position, reducing the number of swaps compared with bubble sort.

  16. 3.16 Sortinghistorical

    This page collects notes on bubble, selection, insertion, merge, quick, and heap sort, comparing their time complexity, space complexity, and stability.