Study library
DSA library
Data structure and algorithm concepts, solved problems and discussions.
11 entries
-
Why greedy fails for coin change
Counter-examples, and why dynamic programming is needed unless the coin system is canonical.
discussion · answered · updated 2026-11-24
-
Amortized analysis
Bounds the average cost per operation over a worst-case sequence, so rare expensive steps are paid for by many cheap ones.
concept · stub · updated 2026-11-24
-
Arrays
A contiguous block of same-sized elements addressed by index in constant time.
concept · stub · updated 2026-11-24
-
Coin change
Find the fewest coins (or the number of ways) that make a target amount from given denominations.
concept · stub · updated 2026-11-24
-
Dynamic array
An array that over-allocates and copies into a larger block when full, giving amortized O(1) append at the end.
concept · draft · updated 2026-11-24
-
Dynamic programming
Solve a problem by combining answers to overlapping subproblems, each computed once.
concept · stub · updated 2026-11-24
-
Greedy algorithms
Build a solution by repeatedly taking the locally best choice, valid only when that choice is provably safe.
concept · stub · updated 2026-11-24
-
Sliding Window Maximum
Maximum of every window of size k in an array.
problem · solved · updated 2026-11-24
-
Monotonic deque
A double-ended queue kept sorted so the front always holds the window's maximum or minimum.
concept · draft · updated 2026-11-24
-
Sliding window
Maintain a contiguous range and update its answer incrementally as the range moves.
concept · draft · updated 2026-11-24
-
Two pointers
Move two indices through a sequence so each element is visited a bounded number of times.
concept · stub · updated 2026-11-24
Nothing matches.