Mason Scott

Logo

View the Project on GitHub 04mscott/Sorting-Functions-C-

C Sorting Algorithms With Python Visualizations

All sort funcs bm

This project demonstrates the implementation of eight classic sorting algorithms in C, coupled with Python-based visualizations to analyze and compare their performance.

C Implementation

The following sorting algorithms were implemented in C, utilizing efficient memory management and function-based modularity:

Each algorithm is benchmarked for runtime performance on datasets of varying sizes and ranges, leveraging a custom benchmarking function written in C. The implementation includes utility functions to generate randomized input arrays, validate sorting correctness, and handle edge cases. Memory-efficient techniques such as in-place operations and heap-based structures were used to optimize performance.

Python Visualization

A Python script leverages the shared library (sort_funcs.so) generated from the C implementation. Using ctypes, the benchmarking function is integrated into Python, allowing runtime measurements for each algorithm across varying input sizes. Libraries such as Matplotlib, Pandas, and Seaborn are used to create detailed visualizations.

Technical Highlights