$ show thuva4/Algorithms
This repository is a large, multi-language algorithm reference library with an interactive web frontend for visualizations. It contains over 247 classic algorithms (sorting, graph, DP, math, strings, geometry, cryptography, etc.) implemented in 11 languages (Python, Java, C++, C, Go, TypeScript, Kotlin, Rust, Swift, Scala, C#). The web application, built with React and TypeScript, provides a browsable catalog, progress tracking, and step-by-step algorithm visualizations. The codebase follows a consistent pattern where most algorithm functions accept a flat integer array as input and return a single integer or array, enabling uniform testing and frontend consumption. While the repository is comprehensive and well-organized at a high level, the quality of individual implementations varies significantly. Some files contain bugs (e.g., mislabeled algorithms, incorrect logic), hardcoded limits, or outdated practices (e.g., conio.h, Python 2 syntax). Duplicate implementations across languages and within the same language increase maintenance burden. The web frontend is modern and well-structured, with reusable components like the visualization registry and progress context. The scaffolding and validation scripts demonstrate good engineering practices for maintaining such a large collection. Overall, this is a valuable educational resource and reference for algorithm implementations across multiple languages, but it is not production-grade software. The codebase is actively maintained with CI workflows and issue templates, but the sheer scale and language sprawl introduce technical drift and inconsistency. It is best suited for learning, competitive programming preparation, and as a starting point for algorithm visualizations.
The LLM identified 3 files worth highlighting for reuse:
Defines the AlgorithmVisualization interface (initialize, step, reset, getStepCount, getCurrentStep) and a registry that maps algorithm slugs to visualization classes. This pattern is cleanly abstracted and can be extracted to build interactive step-by-step visualizations for any algorithm in a new project. It demonstrates good separation of concerns between algorithm logic and visualization state.
Implements a React context and provider for tracking user progress (completed algorithms) with localStorage persistence. The hook useProgress exposes a simple API (isCompleted, markCompleted, resetProgress). This is a self-contained, reusable pattern for any educational or tutorial application that needs to persist user state across sessions.
A Node.js script that generates the directory structure and boilerplate files for a new algorithm across all supported languages. It reads metadata from user input and creates consistent file templates. This pattern is highly reusable for any multi-language project that needs to standardize new additions, reducing manual setup and enforcing conventions.