O(n²) sorting algorithms
Bubble, Insertion and Selection Sort are all quite short -- implement all of them as a Fortran subroutine for sorting an array A of numbers of length n.
Test that it works by sorting 10 numbers in reversed order (10,9,...,2,1), sorted order (1,2,...,9,10) and random order.
Expand the simple testing code to a "test harness" so that you can plot a graph of the CPU_TIME the algorithm takes to sort lists of numbers from, e.g., 10..100 with one line each for inputs in:
inverted order
sorted order
random order (to get stable statistics you'll need to average over a number of runs using RANDOM_NUMBER to setup the unsorted list)
Plot three lines on the same graph and explain any differences or changes, e.g. by annotating the graph.
Hello,
I will implement, in Fortran, for you all 3 required sorting algorithms and do some performance tests. I will also create a graphic with the results (I could use Matlab or Python for plotting the results).
I have a PhD in Physics/Math and experience of FORTRAN programming since 1980. Your project looks like a piece of cake to me. I am a new freelancer and would like to do a good job to build my reputation.
Hi, Expert in numerical programming here. I have worked on both fortran programming and sorting programs in the past during my computational methods course. I can write the subroutines for all the three sorting algorithms. Let me know if you have any queries.
Thanks,
Mohan
I am an expert in FORTRAN with a 30-years experiens.
I am well acquainted in sorting algorithms. So, if you'll need a help for implementing a more advanced algorithms like quicksort or heapsort, we can continue our collaboration.
With kind regards,
Andriy Kostyuk