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

    • dynamic-programming
    • greedy
  • 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

    • complexity
    • proofs
  • Arrays

    A contiguous block of same-sized elements addressed by index in constant time.

    concept · stub · updated 2026-11-24

    • arrays
  • 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-programming
    • greedy
  • 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

    • arrays
    • complexity
  • Dynamic programming

    Solve a problem by combining answers to overlapping subproblems, each computed once.

    concept · stub · updated 2026-11-24

    • dynamic-programming
    • recursion
  • 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

    • greedy
    • proofs
  • Sliding Window Maximum

    Maximum of every window of size k in an array.

    problem · solved · updated 2026-11-24

    • arrays
    • sliding-window
  • 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

    • arrays
    • sliding-window
    • stacks-queues
  • Sliding window

    Maintain a contiguous range and update its answer incrementally as the range moves.

    concept · draft · updated 2026-11-24

    • arrays
    • sliding-window
    • strings
  • Two pointers

    Move two indices through a sequence so each element is visited a bounded number of times.

    concept · stub · updated 2026-11-24

    • arrays
    • two-pointers
Filters (3)
Kind
Status
Topic
Show 4 more