Write and instrument Insertion Sort and Shellsort programs to sort arrays of positive integers. The Shellsort program should use four sets of increments: {1.72n/3,1} {2' – 1|1


How do I solve this in C Program?


Write and instrument Insertion Sort and Shellsort programs to sort arrays of positive integers.<br>The Shellsort program should use four sets of increments:<br>{1.72n/3,1}<br>{2' – 1|1<i < [logn]}<br>{2' | 0 < i < [logn]}<br>|1si s t where t is the smallest integer such that<br>3t+2–1<br>2<br>All integers on the list, which may include duplicates, will lie between 1 and 1,024,000. Use a<br>random number generator to generate the input files and use the same list for each set of<br>increments.<br>Test your programs on arrays of 25,000, 100,000, and 500,000 integers. Use the timing<br>functions available in C to time the work done by each algorithm, with each set of increments<br>(not including I/O). Compare the timings on each list. How do the results compare with those<br>predicted by an analysis of shellsort and insertion sort?<br>Does the number of key comparisons give a realistic measure of the amount of work done?<br>(You may want to count the number of comparisons and exchanges done by each algorithm on<br>each list.) Which set of increments gave the best times? Explain your results and any<br>discrepancies between predicted and actual results.<br>

Extracted text: Write and instrument Insertion Sort and Shellsort programs to sort arrays of positive integers. The Shellsort program should use four sets of increments: {1.72n/3,1} {2' – 1|1
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here