3.Algorithms
Data Structures & Algorithms · 16 notes
- Cache Replacement Policieshistorical
LRU, LFU, FIFO, random and modern approximate policies, with workload-dependent hit-rate trade-offs.
- Dynamic Programminghistorical
Solving overlapping subproblems with memoization/tabulation by defining state, transition, initialization, and answer.
- Greedy Algorithmshistorical
Making locally optimal choices only when the problem structure proves they compose into a global optimum.
- Divide and Conquerhistorical
Split a problem into smaller independent subproblems, solve them, then combine their results.
- Recursionhistorical
Recursive problem decomposition, base cases, call-stack cost, tail recursion caveats, and iterative alternatives.
- Backtrackinghistorical
Search a decision tree by choose–recurse–undo, with pruning and state management.
- Depth-First Searchhistorical
Recursive or explicit-stack DFS for graphs/trees, visitation state, cycle handling, and complexity.
- Binary Searchhistorical
Logarithmic search over a monotonic/sorted domain, including boundary variants.
- Heap Sorthistorical
In-place comparison sorting using heap construction followed by repeated root extraction.
- Insertion Sorthistorical
Stable in-place insertion into a sorted prefix, efficient for small or nearly sorted inputs.
- Quick Sorthistorical
Partition-based sorting with O(n log n) expected time, pivot selection, and worst-case safeguards.
- Selection Sorthistorical
Repeatedly selecting the minimum/maximum with quadratic comparisons and few swaps.
- Sorting Algorithms Overviewhistorical
Comparing sorting algorithms by time, space, stability, adaptiveness, locality, and data constraints.