Skip to content

jamylak/monotonic02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Monotonic Stack Visual Breakdown

This visualisation uses AI Generated code, finetuned for the best visualisation, not code quality

monotonic_stack.mov

Interactive C + Raylib visual breakdown of a monotonic-stack solution, focused on how stack state, pending indices, and next-greater style answers evolve across a dense teaching layout.

What This Visualisation Shows

  • Why a monotonic stack keeps only the still-relevant candidates
  • How pushes and pops correspond to newly resolved answers
  • How a brute-force scan differs from the stack-based solution path
  • A 3x3-style breakdown that keeps the stack, source state, and answer state visible together

Visual Map

flowchart LR
    A["Input Sequence"]
    B["Maintain Monotonic Stack"]
    C["New Value Arrives"]
    D["Pop Weaker Candidates"]
    E["Resolve Pending Answers"]
    F["Push Current Index"]

    A --> B
    B --> C
    C --> D
    D --> E
    E --> F
Loading

Controls

  • q: quit
  • The active scene surfaces the rest of its stepping and teaching controls in-app

Run

make run

About

Monotonic Stack Visualiser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors