The Runtime Theory
easy · 4h · 7 steps

Algorithms Foundations

Start from zero: what algorithms are, how arrays work in memory, and how simple algorithms like linear search actually execute.

Curriculum (7 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 a linear search across 10 array elements, checking each one until the target is found or the array is exhausted.

Start→
5

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

Start→
6

Implement binary search that finds a target value in a sorted array in O(log n) time.

Start→
7

The interview answer covering indexing cost, insertion cost, memory layout, and cache effects.

Start→