3. testing algorithms

  • To measure the results of the sorting algorithms, I implemented functions in order to generate random arrays, time, and, run algorithms.

=>

To measure the results of the sorting algorithms, I implemented various functions. This was in order to generate random arrays, time the functions and, run the algorithms.

  • The testSortingAlgorithms function runs both the mergeSort and selectionSort algorithms on the generated random array compares their performance. The results are displayed in both nanoseconds and milliseconds, with a comparison at the end indicating which algorithm performed better.

=>

The testSortingAlgorithms function runs both the mergeSort and selectionSort algorithms on the generated random arrays and compares their performance. The results are displayed in both nanoseconds and milliseconds, with a comparison at the end indicating which algorithm performed better.