Consider the attached QuickSort algorithm for sorting arrays and two algorithm optimization proposals QSopt1 and QSopt2 described below. QSopt1 executes QuickSort for the partitions of a size larger than a given cutoff value (usually 10) and executes Insertion Sort for sorting the partitions of size less than or equal to the cutoff value. QSopt2 executes QuickSort until all partitions’ size gets lower than a given cutoff value (usually 10) and then, executes the improved Bubble Sort algorithm upon the whole “almost sorted” array. This project requires writing two Java programs detailed below in Part 1 (testing the functionality of the proposed algorithms) and Part 2 (measuring and comparing their execution time). The algorithms for QuickSort, InsertionSort, and BubbleSort are attached.

Leave a Reply

Your email address will not be published. Required fields are marked *