Skip to content

jamylak/kadanes01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kadane's Algorithm Visualizer

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

kadanes.mov

Interactive Raylib visualizer for Kadane's algorithm, showing how the running subarray sum, best-so-far segment, and reset decisions evolve as the scan moves across the array.

What This Visualisation Shows

  • Why a negative running sum should be dropped
  • How the current subarray and best subarray differ
  • How local decisions produce the global maximum subarray
  • A panel layout that keeps scan position, running sum, and winner segment visible together

Visual Map

flowchart LR
    A["Input Array"]
    B["Extend Current Sum"]
    C["Compare With Restart"]
    D["Keep Better Current Subarray"]
    E["Update Best-So-Far"]

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

Controls

  • q: quit
  • Scene-specific stepping controls are shown in the active UI

Run

make run

About

Kadane's Visualiser

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors