Skip to main content

Algorithm visualizers

Array & String Lab

One playground for the fundamentals: traverse, insert, delete, search, and sort arrays, plus string reversal, palindrome checks, and pattern matching. Bring your own data.

time varies by operationspace O(1)–O(n)Read the lesson
Beginnervaries by operation

One playground for the fundamentals: traverse, insert, delete, search, and sort arrays, plus string reversal, palindrome checks, and pattern matching. Bring your own data.

Visit every element once and accumulate the sum, O(n).

step 1 / 8

What's happening

Traversal visits every element exactly once, the foundation of most array algorithms. Array length: 6.

n: 6
visitingalready visited

Understand the algorithm

time varies by operationspace O(1)–O(n)

What it is

The Array & String Lab is a multi-operation playground for the fundamental array operations (traversal, insertion, deletion, searching, sorting) and string operations (reversal, palindrome checking, naive pattern matching).

Why it matters

These are the exercises of algorithmic thinking, the operations every other data structure is compared against. Running them step by step on YOUR own data turns 'insertion is O(n)' from a sentence in a table into something you have watched shift element by element.

How it works

  1. 1Pick Array or String mode, then choose an operation from the chips.
  2. 2Type your own numbers or word, the lab accepts up to 14 elements so every step stays visible.
  3. 3Press Play or step manually; every comparison, shift, and write is narrated and counted.
  4. 4Watch the counters: they are the empirical evidence for the complexity column.

Real-world uses

  • Verifying your mental model before a quiz or interview
  • Testing edge cases: empty input, single element, worst-case positions
  • Seeing WHY middle insertions and deletions cost O(n)
  • Tracing naive pattern matching before learning KMP

Strengths

  • One consistent interface across eight operations
  • Honest counters, comparisons, swaps, writes, visits
  • Custom inputs make every claim testable

Limitations

  • Bubble sort represents the O(n²) family, see the dedicated sort visualizers for the others
  • Pattern matching is the naive O(n·m) version, KMP is a follow-up topic
  • Input is capped at 14 elements for readability

Pick Array or String mode, then an operation. Inputs are capped at 14 elements so every step stays readable.