Hello,
I'm having trouble trying to understand what my teacher is asking on the upcoming homework. He says we need to have to separate instances of quicksort in one source file. Here is his words:
QUOTE
Design and implement two versions of QuickSort over a set of input integers. The first version should choose the pivot as the first array location. The second version should choose the pivot as the middle value of the triple
< first value, last value, (first+last)/2-th value >
Count the number of comparisons performed by the partition function for each version.
He also posted this:
QUOTE
A script file showing you running the test program for:
* Partition 1 with array of size 10
* Partition 2 with array of size 10
* Partition 1 with array of size 20
* Partition 2 with array of size 20
i e-mailed him asking about the comparisons and this was his response:
QUOTE
It is the number of comparisons of array elements needed to sort the array. So you will
need to add up all of the comparisons done in recursive calls.
What does he mean by counting the number of comparisons? is the number of comparisons going to be a value going through both instances of the quicksort or each one indvidually? and how do i make a script file showing the information he wants? i have never had experience with making a script file. thanks