Insertion Sort, Merge Sort, Implementation of Matplotlib to show space time complexity
Objectives for Insertion Sort Code: NOTE: It does take some time for runtime as values of n till 1000 since it takes more runtime for values of n up to 50,000
-
Given a random array of size n sort implement insertion sort.
-
Use the time module in Python or equivalent to time how long it takes to sort an array of n=100, n=10,000, n=100,000, n=1,000,000.Make a plot of runtime vs size n. How would describe the general shape of the graph? How does it compare to what we discussed in class? (hint: you may need more points to get a better picture of the time complexity)
-
Modify insertion sort to sort the elements in an array in descending order
-
Modify insertion sort to sort alphanumeric values