How ganth1811/sorting-algorithm-comparison works
Main Components
• Data Generator: Represented by DataGenerator.cpp and DataGenerator.h. This module is responsible for creating test data of various sizes and orders.
• Sorting Algorithms: Each sorting algorithm has its own source file (e.g., bubble_sort.cpp, quick_sort.cpp, merge_sort.cpp, etc.). These implement the different sorting techniques. The common interface in sorting_algorithm.h suggests that they share a unified API or structure.
• Program Orchestration: main.cpp, program.cpp, and program.h likely serve as the entry point and coordination logic that calls the data generator and the sorting routines, measures performance, and maybe logs results.
• Project Notes & Documentation: The “Project Note” folder contains supplementary documentation (like the ProjectDescription.pdf), which can inform additional context or constraints for the design.
Relationships and Interactions
• The Program Orchestration sits at the center, receiving test parameters from the user (or pre-defined tests), then invoking the Data Generator to create datasets.
• Once data is created, the orchestration layer iteratively sends the data to each sorting algorithm implementation (using a common interface as defined by sorting_algorithm.h) and collects performance metrics.
• The various sorting modules (each sorting algorithm) can be seen as interchangeable or plug-in components used by the main control flow.
Architectural Patterns
• Modular Design: Each sorting algorithm and the data generator are developed as separate modules, which makes it easy to add or remove implementations.
• Interface Abstraction: The use of sorting_algorithm.h implies that each algorithm conforms to a standard interface, allowing the orchestration module to interact with them polymorphically.