Highlights
You are to write static methods that implement insertion sort (described in the book and in lecture 9), various quicksort algorithms (basic algorithm is in the book and explained in lecture 9 – important improvements described in lecture 10), and heapsort (lecture 10) by completing the class and methods shown below.
The faster your sorts, the better. If your program runs too slowly, it probably means there is something wrong. I will eventually create a test program that will show the speeds of your sorts but I strongly recommend that you write your own test program so that you can start testing your sorts immediately
A few reminders and rules (ask about these if you have questions!): All of your sorts should work on 0-element arrays. Shift rather than swap during insertion and heap sorts. Be sure your various quicksort methods are making recursive calls to the proper quicksort method. Since there are multiple quicksorts it is easy to accidentally make the wrong recursive calls
The cutoff parameter in your quicksorts represents the smallest sized partition that will be recursively sorted, as described in the beginning of lecture 10. For example, if cutoff = 10 then a partition with 10 elements will be recursively sorted while a partition of size 9 or less will not. Be sure you get this exactly right. It is easy to be off by 1.
To be sure the stack does not overflow in your quicksorts write your recursive quicksort methods with a loop that: (1) selects the pivot, (2) partitions the array by calling a partition method, (3) makes the recursive call on the smaller partition(s), and (4) sets parameter values so that the loop simulates the second/third recursive call on the larger/largest partition. See the example on page 3 of lecture 10.
You are to write each of the following quicksort algorithms:
QuickSort1: outside-in partition, random pivot
QuickSort2: left-to-right partition, random pivot
QuickSort3: 2-pivots, both random
QuickSort4: outside-in partition, pivot = a[lf]
QuickSort5: left-to-right partition, pivot = a[lf]
AlmostQS1: Exact same driver as QuickSort1 except the call to InsertionSort is commented out
AlmostQS2: Exact same driver as QuickSort2 except the call to InsertionSort is commented out
AlmostQS3: Exact same driver as QuickSort3 except the call to InsertionSort is commented out
Also, write two heapsort methods. HeapSortTD builds the heap top-down (the slow way) and HeapSortBU builds the heap bottom-up (the fast way)
Submission and other details: Of course this time the name of your file should be prog3.java. This should not be the name of your class. Do not use the word package anywhere. If you submit multiple times Canvas tacks a suffix onto your file name. I can live with that. Just make sure the base part of the file name is prog3.java
This IT/Computer Science Assignment has been solved by our IT/Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.