Insertion Sort on Random Arrays and Plotting the Running Times

  • We generate random arrays of varying sizes and output the time taken to insertion_sort_times.csv file. src
  • Next we plot the values in the insertion_sort_times.csv and try fitting a curve to it. src
$ g++ insertion-sort.cpp  -o insertion-sort
$ ./insertion-sort 
$ python3 plot_insertion_sort.py

Created: 2026-02-18 Wed 19:15

Emacs 30.2 (Org mode 9.7.11)