Binary Search Variants: Beyond Simple Lookup
Choose binary search for monotone predicates and ternary search for unimodal objectives. Learn lower bounds, rotated-array search, and termination invariants.
Choose binary search for monotone predicates and ternary search for unimodal objectives. Learn lower bounds, rotated-array search, and termination invariants.
Apply masks, shifts, and popcount patterns safely. Learn how integer width, signedness, language rules, and overflow affect bit operations.
Learn five coding interview patterns, derive constraints before choosing one, and practice each with a recognition problem, variation, and mixed exercise.
Compare counting sort at O(n + k) with radix sort at O(d(n + b)), including stable digit passes, range costs, and signed-integer handling.
Learn Dijkstra's algorithm for single-source shortest paths in graphs with non-negative edge weights, including implementations and trade-offs.
Learn divide and conquer through merge sort, quicksort, and binary search, with recurrences that show how subproblem costs add up.
Apply dynamic programming to tree and graph structures using DFS-based state propagation for optimal subtree and path calculations.
Learn how to identify optimal substructure, define DP state variables, and formulate recurrence relations correctly.
Learn dynamic programming with memoization, tabulation, and examples of how to identify subproblems.
Solve the minimum edit distance problem using dynamic programming with applications in spell checking, DNA alignment, and autocomplete.