insertionSort:

What are the four steps in quickSort?
1. Choose on item from the list as a pivot
What is worst case running time of selectionSort()?
O(n2)
What is the worst case running time for insertionSort()?
O(n2)
What is the worst case running time of quickSort()?
What is it’s average?
O(n^2)
The average is closer to (nlogn)
What is the worst case running time for mergeSort()?
O(nlogn)
What is the formula for determining the run time of Radix sort?
What does each variable stand for?
O(d(N + n)
d = digits
N = work to be done, number of buckets
n = amount of items
How does mergeSort work?
What at the main functions?
While there is more than 1 item, creates a temp array, it splits the list in half, sorts each side, then merges the items back together.
Base Case:
How does radixSort work?
In the case of int:
radixSort:
What would need to be done sorting strings of different lengths?
strings would need to be padded on their right sides with null
It’s a sequence of 0-bits so it’s order is always smaller
For insertion sort, what are the main variables?
int siftVal
int j;
For insertion Sort, what are the for loop conditions
for(int i = 1; i< a.length; i++)
For insertion sort, what are the while loop conditions?
while(j >= 0 && a[j] > siftVal)
for insertion sort, what is the for loop code?
for(int i = 1; i< a.length; i++){
siftVal = a[i];
j = i-1;
while(){
}
a[j+1] = siftVal;
}
}
For insertion sort, what is the while loop code?

What is the entire insertSort code?

What is the public driver method of merge sort?

What is the private helper method for mergeSort?

For mergeSort what is the code for the merge function?

For quickSort, what is the public driver method?
public void quickSort(int[] a){
quickSort(a, 0, a.length);
}
What is the private helper method for quickSort?

What is the code to chose a pivot randomly?
import java.util.*;
private static Random generator = new Random(System.nanoTyime());
int randomIndex;
randomIndex = generator.nextInt(end- start)+start;
for quickSort, when partitioning, what is the form of the array?

What is the partition function code for quickSort?
