Repeat the previous exercises for the best-case input: that is, for the input array A[1 . . . n] on which the given algorithm performs the best, how many comparisons/swaps does the algorithm do? (If the best-case array for swaps is different from the best-case array for comparisons, say so and explain why, and analyze the number of comparisons/swaps in the two different “best” arrays.) In the best case, how many comparisons and how many swaps are done by these 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