Question: Quiz Instructions Lab 7: Sorting Algorithms and Algorithm Analysis Objective: practice with sorting algorithms: 1. O(n2) Algorithms 1. Bubble sort 2. Selection sort 3. Insertion


Quiz Instructions Lab 7: Sorting Algorithms and Algorithm Analysis Objective: practice with sorting algorithms: 1. O(n2) Algorithms 1. Bubble sort 2. Selection sort 3. Insertion sort 4. Shell sort 5. Quicksort 2. O(nlogn) Algorithms 1. Merge sort 3. O(n) Algorithms 1. Counting sort 2. Radix sort 3. Bucket sort Merge Sort Merge sort is another divide-and-conquer sorting algorithm. It always performs according to O(nlogn). It has two subroutines: splitting an array into parts recursively and recursively merging sorted parts. How many times mergeSort is called in the code above? Since the merge sort is based on dividing and merging lists (arrays), there is no in-place exchange (swapping) of items. However, we can trace the sorting procedure by verifying what items are compared and sorted first. What two items are compared first? What two items are compared last? How many comparisons of items are done
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
