Question: A 16 element array stores a set of integers that are to be sorted using the merge sort. a. Using the formulas presented in Table

A 16 element array stores a set of integers that are to be sorted using the merge sort.

a. Using the formulas presented in Table 8.6, how many comparisons would be made to sort the 16 items.

b. Using the formulas presented in Table 8.6, how many swaps would be made to sort the16 items.

A 16 element array stores a set of integers that are to

Table 8.6 Performance of the Quicksort Algorithm Memory Overhead Range Bytes Speed Comments Effort Algorithm Binary Tree ast/slowe Range Fast for random data, sow for already sorted data high 8n Highest overhead Fast for data almost sorted in ascending order. Slow for most data sets kowest4 Bubble very fast/slow O(n)/On) 0 Number of swaps SE12 Low overhead. Fasy to oode. Fast for all data sets. Low overhead. Heap fast lowest Number of swaps 2SE/S SE a (0.75m)logn Number of swaps 2.67SE moderate Fast for all data sets. fast O("log.") fast/slow Merge Sort Moderate overhead. 8+8 Pastest for most data (n-1) 0(#9 for certain data Quicksort low log sets, but could be Average 1.45 "log2(n) Number of swaps 025SE sets Easy to code. Low overhead

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!