Sikau

Learn Algorithms

Search, sort, two pointers, greedy, graphs and dynamic programming.

Learn the techniques that turn slow code into fast code and hard problems into solvable ones. Binary search and its bounds, merge sort, quicksort and quickselect, two pointers, sliding windows, prefix sums, greedy choices, backtracking, Dijkstra, topological sort and dynamic programming — each implemented in JavaScript with checks for both correctness and speed.

Advanced · 15 lessons · about 9 hours · free

Start Algorithms free: run real code in your browserright here

Continue with Google

What you will learn

Unit 1: Searching and sorting

Binary search, sorting with comparators, merge sort, quicksort and quickselect.

  1. Day 1Binary searchFind things in sorted data in O(log n) — and the off-by-one traps.30 min
  2. Day 2Sorting basicsInsertion sort, comparators, stability and what .sort() really does.30 min
  3. Day 3Merge sort: divide and conquerSplit, sort the halves, merge — O(n log n) every time.35 min
  4. Day 4Quicksort and quickselectPartition around a pivot; find the k-th smallest in O(n) on average.35 min
  5. Day 5Project: Learning leaderboardSorted scores, ranks with ties, and fast rank lookups.40 min

Unit 2: Problem-solving techniques

Two pointers, sliding windows, prefix sums, greedy choices and backtracking.

  1. Day 6Two pointersWalk a sorted array from both ends (or at two speeds) in one pass.30 min
  2. Day 7Sliding windowBest subarray or substring in one pass by growing and shrinking a window.35 min
  3. Day 8Prefix sumsPrecompute running totals to answer any range-sum question in O(1).30 min
  4. Day 9Greedy algorithmsTake the best-looking choice now — and know when that's provably right.35 min
  5. Day 10BacktrackingExplore choices recursively, undo, and prune dead ends.40 min

Unit 3: Graphs and dynamic programming

Dijkstra, topological sort and dynamic programming, combined in a planning capstone.

  1. Day 11Shortest paths: DijkstraWeighted graphs, a priority queue, and the fastest route everywhere.40 min
  2. Day 12Topological sortOrder tasks so every dependency comes first — and detect cycles.35 min
  3. Day 13Dynamic programmingOverlapping subproblems: memoise, then build tables bottom-up.40 min
  4. Day 14DP classics: edit distance and knapsack2-D tables for comparing strings and choosing under a budget.45 min
  5. Day 15Capstone: Plan the rider's shiftDijkstra for travel times, then knapsack to pick the best deliveries.55 min

Before you start

These courses make Algorithms easier:

See all courses

Built with ❤️ by dibe.sh