Problem Description
The project documentation correctly lists the theoretical time complexities (e.g., Bubble Sort is O(n²), Merge Sort is O(n log n)). However, there is no dynamic way to prove this to a learner on their specific hardware. An interactive educational suite should ideally allow users to empirically verify the theoretical Big-O bounds of the algorithms they are learning.
Proposed Solution
Implement a "Big-O Verification Engine" that runs algorithms at scaling input sizes to empirically calculate their growth rate.
- Create a benchmarking harness that takes a function pointer to a sorting or searching algorithm.
- Run the algorithm on randomized datasets of size
N, 2N, and 4N, measuring the execution time using <time.h> (clock()).
- Calculate the time ratio
T(2N) / T(N). If the ratio is ~2, display O(N). If the ratio is ~4, display O(N²).
- Render a simple text-based table in the TUI/CLI showing the input size, time taken, and the deduced empirical time complexity.
Additional Context
Suggested Labels: new feature, Hard, SSoC26
Note for Maintainers: I have cleared my previous pending assignments and my queue is empty. I am well aware of the project's strict formatting and memory safety standards. If assigned, I guarantee that I will run make fmt, make test, and make valgrind to ensure zero memory leaks and proper clang-formatting before raising the PR. Could you please assign this to me?
Problem Description
The project documentation correctly lists the theoretical time complexities (e.g., Bubble Sort is O(n²), Merge Sort is O(n log n)). However, there is no dynamic way to prove this to a learner on their specific hardware. An interactive educational suite should ideally allow users to empirically verify the theoretical Big-O bounds of the algorithms they are learning.
Proposed Solution
Implement a "Big-O Verification Engine" that runs algorithms at scaling input sizes to empirically calculate their growth rate.
N,2N, and4N, measuring the execution time using<time.h>(clock()).T(2N) / T(N). If the ratio is ~2, displayO(N). If the ratio is ~4, displayO(N²).Additional Context
Suggested Labels:
new feature,Hard,SSoC26Note for Maintainers: I have cleared my previous pending assignments and my queue is empty. I am well aware of the project's strict formatting and memory safety standards. If assigned, I guarantee that I will run
make fmt,make test, andmake valgrindto ensure zero memory leaks and proper clang-formatting before raising the PR. Could you please assign this to me?