March 11, 2026
Going bananas over suffix trees
Visualizing Ukkonen's Suffix Tree Algorithm
Watch a 'banana' algorithm come to life — and the comments go bananas over RAM and AI tools
TLDR: A click-through demo makes a tricky “find text fast” method understandable by showing a banana example grow step by step. Readers praised it, plugged Google’s Gemini Canvas, warned suffix trees can guzzle memory, and shared an offline C++/Graphviz version—splitting the crowd between AI convenience and lean, local builds.
A developer turned a famously brain-bending text search trick into a watchable show: press play and see a tree “grow” from the word banana. It’s a visual take on Ukkonen’s method, which normally lives in dense textbooks and papers. Instead of squinting at pseudocode, you get a step-by-step, gold-highlighted tour. Cue the crowd: some cheered, but the real action spilled into the comments.
One camp immediately went, “Why not AI?” with a shoutout to Gemini Canvas for making visuals on the fly—one user even said it helped explain song chord progressions. That set off the tool wars: hand-crafted demos vs. AI-assisted explainers. Others pulled the emergency brake with a classic hot take: suffix trees may be cool, but they’re RAM-hungry monsters in the real world. Memes flew (“RAM go brrr”), and someone joked their laptop would scream if they tried this at home. Then came the offline counterpunch: a reader dropped a C++ + Graphviz version, igniting a cloud-versus-local scuffle—convenience and polish vs. lean and private. In between fruit jokes (banana! cacao!) and “active point” nicknames, the thread turned into a lively mix of classroom nostalgia, production reality checks, and a reminder that the best tool depends on whether you’re learning, shipping, or just here for the show.
Key Points
- •The author implemented Ukkonen’s 1995 suffix tree algorithm to build a data structure for fast substring search.
- •Understanding the algorithm’s dynamics (active point, suffix links, extension rules) was difficult from pseudocode alone.
- •An interactive visualization was built with JavaScript and D3.js to render the tree after each operation.
- •The visualization constructs a suffix tree for “banana,” highlighting the active point and suffix links and offering playback controls.
- •The article emphasizes the test_and_split procedure and shows when edges are split and leaves created versus when an existing transition ends an update.