This simple project benchmarks two sorting algorithms (Selection Sort and Insertion Sort) on multiple input files of numeric data.
-
Compile the program:
make
-
Execute the program:
./sorting
The program reads numeric data from a series of input files located in the instancias-numericas
directory and measures the time taken to sort the data using two different algorithms: Selection Sort and Insertion Sort.
- The input files are located in the
instancias-numericas
directory. - Each file contains a list of numbers to be sorted.
- Scenario 1: Selection Sort with Array
- Scenario 2: Insertion Sort with Array
For each input file, the program will print the time taken to sort the numbers using each algorithm. At the end, it will summarize the time taken for each scenario.
Selection Sort with Array: instancias-numericas/num.1000.1.in
Time taken for instancias-numericas/num.1000.1.in: 0.002345 seconds
Insertion Sort with Array: instancias-numericas/num.1000.1.in
Time taken for instancias-numericas/num.1000.1.in: 0.001234 seconds
...
Time taken for each scenario:
Scenario 0: 0.002345
Scenario 1: 0.001234
- Standard C library
- Puca Vaz