How surajklmn/algolizer works
Project type and purpose
• Algolizer is a C++-based desktop application (an open-source visualization tool) that uses Raylib (and Raygui) to render and interactively demonstrate data structures and algorithms in real time.
File structure
• Top-level:
• CMakeLists.txt – build configuration
• docs/ – design proposals and reports
• external/raygui – third-party UI widget library
• src/ – application source code
• src/ is subdivided into:
• core modules (array, linked_list, tree, graph) – implement data structures
• algorithm modules (bubble_sort, quick_sort, binary_search, etc.)
• utils (InputBox) – UI helper
• main.cpp / main.h – application entry point, event loop, and coordinator
Key insights from README
• Core functionality: interactive visualization of structures and step-by-step algorithms
• Dependencies: Raylib (graphics), Raygui (widgets), CMake, GCC/G++
• No network or persistent storage—purely in-memory, real-time graphics
Main components
a. Application Entry Point (main)
– Initializes Raylib, sets up window & canvas
– Loads/initializes Raygui
– Drives the main event/render loop
b. UI Layer
– Raygui widgets for menus, buttons, InputBox (src/utils)
– Captures user input (select structure/algorithm, tweak parameters)
c. Controller / Coordinator
– Interprets UI events, dispatches to algorithm/data modules
– Manages “play/pause/step” state for animations
d. Model (Data Structures & Algorithms)
– Data modules: array, linked_list, tree, graph
– Algorithm modules: sorting (bubble, quick, merge, selection, insertion), searching (binary, linear), queue, stack
– Each algorithm exposes a “step()” API to advance visualization state
e. Visualization Engine (View)
f. External Libraries
– Raylib: windowing, drawing, input, timing
– Raygui: high-level UI widgets
g. Build System
– CMake orchestrates compilation, links Raylib and the app
Relationships and data flows
• User Input → Raygui (UI Layer) → Controller
• Controller → Model (algorithm/data) “step” / “reset” calls
• Model returns updated state → Visualization Engine
• Main loop coordinates polling, updating, rendering each frame
Architectural patterns & design principles
• Modular separation of concerns: UI, Controller, Model, View
• Plugin-style algorithm modules: easy to add new algorithms by conforming to a “step()” interface
• In-memory, single-process desktop app—no network or DB layers