Course syllabus

Data Structures and Algorithms

Begin with arrays, linked lists, stacks, queues, trees, and graphs. Each lesson shows how the data is laid out, how common operations work, and what those operations cost.

The algorithm lessons build on those structures. Sorting explains how order is created; searching explains how ordered data lets a program discard work.

Curriculum section

Start with the foundations

Learn how to describe an operation, estimate its running time, and choose storage that matches the work a program performs.

Curriculum section

Linear data structures

These structures keep values in a sequence. The important difference is how each one finds, inserts, and removes an item.

Arrays

Contiguous storage: indexing is constant time, but inserting in the middle is not.

Linked lists

Order comes from references between nodes, so inserting is cheap but indexing is not.

Stacks

Last in, first out. The restriction is what makes execution order useful.

Queues

First in, first out, plus the ring buffers and double-ended variants built on it.

Strings

A string is an array of characters, with its own scanning and matching techniques.

Curriculum section

Trees, graphs, and indexed structures

Use these when relationships branch, connect in many directions, or need faster lookup than a simple scan.

Trees

Hierarchies that branch, and the balancing rules that keep them shallow.

Balanced and disk-based trees

Self-balancing variants that bound height, and the wide trees built for disk.

Indexed trees

Trees over an array that answer range queries and updates in logarithmic time.

Heaps and priority queues

Keep the smallest or largest item reachable while values keep arriving.

Hashing and prefix structures

Constant-time lookup by key, and trees keyed on shared prefixes.

Graphs

Vertices and edges, and the connectivity structures built on them.

Curriculum section

Core algorithms

Algorithms transform or inspect the structures above. Each group below shares one idea: creating order, discarding work, scanning with indexes, or arithmetic on whole numbers.

Sorting

Ordering makes every later lookup cheaper. These lessons compare how each algorithm moves values, what it costs, and when it is the right choice.

Searching

Once data is ordered, a search can discard half the remaining candidates at every step instead of scanning them all.

Scanning with indexes

One pass, two moving positions. These techniques avoid rescanning a sequence that has already been examined.

String matching

Find a pattern inside a longer text without restarting the comparison after every mismatch.

Number theory

Arithmetic on whole numbers: divisibility, primes, modular results, and the identities that keep them fast.

Curriculum section

String algorithms

Linear-time scanning of text: match a pattern, measure palindromes, or compare substrings in constant time.

Curriculum section

Numbers and counting

The arithmetic a competitive or interview problem assumes you already know.

Curriculum section

Problem-solving methods

These methods apply when a direct scan is not enough: the problem has overlapping subproblems, a safe local choice, or a structure of connections to explore.

Recursion and reuse

Split a problem into smaller versions of itself, avoid solving the same version twice, and undo a choice that leads nowhere.

Making local choices

Commit to the best option available right now, and justify why that choice cannot be regretted later.

Graph traversal

Visit every reachable vertex in a defined order. That order is what makes the rest of graph work possible.

Shortest paths and spanning trees

Weighted graphs: reach every vertex as cheaply as possible, or connect them all for the least total cost.

Bitwise techniques

Treat an integer as a row of flags and let single hardware instructions do the set operations.

Curriculum section

Advanced dynamic programming

Once a state is more than one index, the shape of that state is the whole design decision.

Curriculum section

Flows, colouring, and heuristics

Graph problems that are not shortest paths: how much can flow, how few colours are needed, and how to search with an estimate.