How aztfirespell/metodosordenacion works
Project Overview & Purpose
• The project is a performance benchmarking tool for four different sorting methods (Bubble, Shell, Insertion, QuickSort) implemented in C/C++.
• Additionally, the automation invoked by a batch file (“graficar.bat”) launches an Excel workbook (“grafica1.xlsm”) that contains a macro (with code found in “visual.txt”) to generate the graph.
And Label Main Components
• Core Sorting Module (sistema.cpp)
• Implements the logic to generate the random array.
• Contains the implementations for Bubble Sort, Shell Sort, Insertion Sort, and QuickSort.
• Measures and logs execution times.
• Output Data Module:
• Generates a file, likely “TiempoFinal.txt” (referenced in the README), that logs the performance results.
• Visualization Module:
• Consists of the Excel macro file (“grafica1.xlsm”) that generates a graph.
• Contains supporting Visual Basic code (provided in “visual.txt”) for automation.
• The process is triggered through the “graficar.bat” batch script, which runs the Excel file.
Relationships and Data Flow
• The flow starts with the execution of the main program (sistema.cpp), which sets off the following:
• Random data generation → processing by each sorting method → time measurement.
• After sorting, the performance results get written into “TiempoFinal.txt”.
• Once the results are logged, the program (or a subsequent process) executes “graficar.bat”.
• The batch file then opens “grafica1.xlsm”.
• Within “grafica1.xlsm”, a Visual Basic macro (from “visual.txt”) reads “TiempoFinal.txt” and generates the corresponding graphical output.
• From “sistema.cpp” to “TiempoFinal.txt”
• From “TiempoFinal.txt” to “graficar.bat” (or mark “graficar.bat” as the trigger to call Excel)
• From “graficar.bat” to “grafica1.xlsm”
Architectural Patterns & Design Principles
• Modularity – the design clearly separates computation (sorting logic in sistema.cpp) from visualization (Excel workbook and Visual Basic code).
• Loose Coupling – the performance measurement and output (data file generation) are decoupled from the visualization, which is triggered externally.
• Use of external automation – leveraging batch scripting and Excel’s macro capabilities acknowledges integration with third-party tools.
• Although not an MVC architecture, the separation of concerns (processing vs. displaying results) is an important design principle here.