Algorithm Showcase

Valid Palindrome

Interactive retro-terminal visualization of three algorithmic approaches to LeetCode 125. Compare complexity, watch execution, understand tradeoffs.

Complete · Live Demo Open Source

The Problem

LeetCode 125: Determine if a string is a valid palindrome, considering only alphanumeric characters and ignoring cases.

A palindrome reads the same forwards and backwards — but the challenge isn't just solving it. It's understanding why different approaches have different tradeoffs and being able to explain them under pressure.

Three Implementations

Same problem, three ways — each with distinct time/space tradeoffs:

Two-Pointer

Time: O(n) · Space: O(1)

Walk from both ends toward the center. Compare characters, skip non-alphanumeric. No extra memory — the optimal approach for interviews.

Reverse & Compare

Time: O(n) · Space: O(n)

Build a filtered string, reverse it, compare. Clean and readable. Uses O(n) extra space for the reversed copy.

Recursive

Time: O(n) · Space: O(n)

Base case + recursive step. Elegant but stack-heavy. Great for demonstrating recursive thinking, impractical for large inputs.

The Interactive Showcase

This isn't just code — it's a retro terminal-style visualization that makes algorithms tangible. CRT scanlines, phosphor glow, and step-by-step execution you can control.

  • Step-by-step animation — Watch each algorithm execute with visual highlighting. See exactly which characters are being compared and why.
  • Compare metrics — Time complexity, space complexity, allocations, comparisons, early exits — all tracked live.
  • Preset examples — Classic palindrome, edge cases, numeric strings, complex mixed characters.
  • Custom input — Test any string you want. See how each algorithm handles your specific case.
  • Adjustable speed — Slow down to understand every step, speed up for quick verification.

What This Demonstrates

A small-scope, high-polish project that proves several things at once:

  • Algorithmic thinking — Multiple approaches, complexity analysis, tradeoff reasoning. Not just "it works" but "here's why this is optimal."
  • Frontend craft — CSS animations, retro terminal aesthetic, responsive design. The visual polish is intentional, not accidental.
  • Technical communication — Making abstract algorithms concrete and understandable. The visualization teaches better than a README.
  • Attention to detail — Edge cases, metrics tracking, user experience. No shortcuts.

The Principle

This project embodies a core belief: craft over complexity. A palindrome checker is trivial. A palindrome checker with thoughtful visualization, metrics, and polish is not.

The same principle applies to production systems: the difference between "it works" and "it's well-built" is attention to the details that users (and interviewers) actually notice.