Guided lesson

Strings

Linear Data Structures

Strings

Core

Mental model

  • Many languages make strings immutable.

Operations

index

Cost shape

Scan O(n), concatenate often O(n)

Watch out

Repeated concatenation in loops.

Related algorithms

KMP String SearchRabin-KarpTrie Insert and Search
Guided progression
10% lesson
Step 1 / 2Learner goal
Speech settings Speed 1.0 · Volume 90%

Keyboard: Space play/pause · Arrow keys step · Page Up/Down change sections · R restart