The Kafka Client Framework ("StreamKernel") has moved.
This repository is now dedicated exclusively to Algorithmic Benchmarking and Computer Science Fundamentals (Big O Analysis).
If you are looking for the High-Performance Kafka Source/Sink Framework, DLQ patterns, or SPI implementation, please update your bookmarks and stars to the new location.
"Theory tells you O(N log N) is fast. The Arena shows you how fast."
Algorithm Arena modernizes classic CS concepts using Java 21 features such as Records, Pattern Matching, Sealed Classes, and Virtual Threads.
At its core is a Polymorphic Benchmarking Arena that compares algorithms in real time, validating theoretical Big‑O performance against real execution behavior.
Every sorting algorithm extends the BigOSort base class and must declare its best/average/worst-case time complexity and space complexity (bigOContract()), so the Big-O numbers ship alongside the implementation instead of living only in comments.
Benchmark 14 sorting algorithms under controlled conditions.
Includes:
- Identical randomized datasets
- Millisecond/microsecond timers
- Automatic sorting verification (
isSorted()check after every run)
The same contract-and-benchmark pattern as sorting, applied to search: BigOSearch declares each algorithm's complexity, and SearchComparison runs Linear/Binary/Jump search against an identical dataset, verifying both a present and an absent target.
SortingComparison proves correctness at one size; ScalingBenchmark proves the growth rate is real by timing every sort across five input sizes (1k → 16k) and printing the runtime ratio between each doubling. O(n²) algorithms trend toward a ~4x ratio, O(n log n) toward ~2x, and O(n + k) algorithms stay roughly flat — so the Big-O label isn't just a string, it's something you can watch happen.
./gradlew run -PmainClass=com.example.arena.sorting.ScalingBenchmarkCorrectness isn't just eyeballed from console output — src/test/java (269 tests) validates every sorting algorithm, every search algorithm, the graph traversal/shortest-path algorithms, the Fibonacci implementations, and every data-structure sample's Big-O contract against a battery of edge cases (empty, single-element, duplicates, negative numbers, already sorted, reverse sorted, unreachable nodes, large random input) and fails the build on any mismatch.
./gradlew test| Topic | Package | Contract / Runner |
|---|---|---|
| Sorting (14 algorithms) | sorting.algorithms |
BigOSort / SortingComparison, ScalingBenchmark |
| Searching (Linear, Binary, Jump) | search.algorithms |
BigOSearch / SearchComparison |
| Data structures (array, list, stack, queue, hash table/map/set, heap, matrix, BST, graph, weighted graph) | datastructures |
BigODataStructures / DataStructureShowcase |
| Graph traversal (BFS, DFS) & shortest path (Dijkstra) | datastructures.GraphSample, datastructures.WeightedGraphSample |
— |
| Recursion vs. Dynamic Programming (Fibonacci: naive/iterative/memoized) | numbersequences |
FibonacciComparison |
| Sliding window, two pointers, top-K | algorithms |
— |
| Classic interview problems (trapping rain water, merge intervals, group anagrams) | hackerrank |
— |
| Generic Java-language demos (inheritance, static usage, singleton patterns, streams, production-incident debugging) | javafundamentals |
Kept separate from the CS-fundamentals content above |
Algorithm Arena is a blend of:
- Algorithm benchmarking
- Automated correctness validation
- Modern Java 21 exploration
This project is licensed under the MIT License - see the LICENSE file for details.
Author: Steven Lopez