The Runtime Theory
medium · 16h · 20 steps

Algorithms Intermediate

Arrays, hash tables, trees, and recursion — the core data structures and patterns you need to solve coding problems efficiently.

Curriculum (20 steps)

1

A precise, step-by-step procedure for solving a problem or completing a task, illustrated with pseudocode and real-world analogies.

Start→
2

Why array indexing is O(1), how the CPU computes element addresses, and what spatial locality means for performance.

Start→
3

Visualize how contiguous array memory enables cache-friendly access while scattered linked list nodes cause pointer-chase cache misses.

Start→
4

Follow an array insertion from capacity check through resize, element shift, and write, showing why middle insertion is O(n).

Start→
5

Follow a linear search across 10 array elements, checking each one until the target is found or the array is exhausted.

Start→
6

How a function can solve a problem by delegating a smaller version of the same problem to itself, the call stack, and common pitfalls.

Start→
7

Follow factorial(5) from the initial call through five stack frames, the base case at factorial(0), and the return unwinding that produces 120.

Start→
8

An analysis begins by naming the input size and the operation whose growth matters.

Start→
9

Follow the key state changes and boundary checks involved in a practical method for analyzing algorithms.

Start→
10

An array stores elements in contiguous indexed positions.

Start→
11

Follow the key state changes and boundary checks involved in arrays and linked lists: cost follows access pattern.

Start→
12

An interactive concept flow for arrays and linked lists: cost follows access pattern, from its assumptions through the main operation and boundary checks.

Start→
13

Decide whether any value occurs more than once, and compare a set-based solution with sorting the input.

Start→
14

A hash table transforms a key into a hash value and uses part of that value to select a bucket or slot.

Start→
15

Follow the key state changes and boundary checks involved in hash tables: from keys to buckets.

Start→
16

An interactive concept flow for hash tables: from keys to buckets, from its assumptions through the main operation and boundary checks.

Start→
17

Two Sum

practice

Return the indices of two distinct values whose sum equals the target.

Start→
18

A search tree organizes keys so comparisons guide a search toward one subtree.

Start→
19

Follow the key state changes and boundary checks involved in trees and heaps solve different ordering problems.

Start→
20

LRU Cache

practice

Implement get and put in constant average time while evicting the least recently used key at capacity.

Start→