Courses‎ > ‎AP Computer Science 2‎ > ‎konstantinovich‎ > ‎

2018-03-23

posted Mar 23, 2018, 10:14 AM by Konstantinovich Samuel
Improving our nlogn sorts... using n^2 sorts?!?!??

1. Can you write a version of insertion sort that works on a sub-array, similar to merge and quicksort?
e.g.
insertionsort(data, lo, hi)  

The insertion sort is n^2, but has a low constant.


Goal:
Improve both your quicksort and your mergesort by using the insertion sort.

I will run your merge + quick again on Monday to catch the improvements and post times.
I will post by OSIS, and have the average completion time, ONLY if all test cases passed. 

Comments