Fenwick Trees: Binary Indexed Trees
Fenwick trees support prefix sums and point updates in O(log n). Learn the one-based index walks, coordinate compression, and when a segment tree fits better.
Fenwick trees support prefix sums and point updates in O(log n). Learn the one-based index walks, coordinate compression, and when a segment tree fits better.
Master the Floyd-Warshall algorithm for finding shortest paths between all pairs of vertices in weighted graphs, with implementation examples and trade-offs.
Learn when greedy algorithms are correct, prove a choice with an exchange argument, and compare activity selection, Huffman coding, and knapsack.
Deep dive into each major sorting algorithm with implementations, complexity analysis, and when to use each.
Compare 0/1, unbounded, and fractional knapsack with dynamic programming solutions, loop-direction rules, memory estimates, and variant-specific examples.
Learn Kruskal's algorithm for finding minimum spanning trees in weighted graphs using union-find data structures.
Compare linear and binary search algorithms, understand when to use each variant, and master binary search for production systems.
Find the longest strictly increasing subsequence in O(n log n) time using patience sorting and binary search techniques.
Understand the two fundamental DP approaches—top-down with memoization and bottom-up with tabulation—plus hybrid techniques like the/m on the fly.
Learn Prim's algorithm for finding minimum spanning trees starting from a vertex, using a greedy approach with priority queues.