See Figure 6.22 for another reminder of three comparison-based sorting algorithms: Selection, Insertion, and Bubble Sorts. For each of the following problems, give an exact answer (not an asymptotic one), and prove your answer. For the worst-case input array of size n, how many comparisons are done by these algorithms?
Figure 6.22: Another reminder of the sorting algorithms
1.selectionSort
2. insertionSort
3. bubbleSort
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here