Question: Exercise 6.4. Timing Selection Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time:




Exercise 6.4. Timing Selection Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points: Give times for two runs with 2N points: Do you think the theoretical estimate was fairly accurate or not? Exercise 6.5. Timing Insertion Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points: Give times for two runs with 2N points: Do you think the theoretical estimate was fairly accurate or not? How well would doubling the time for N points work as a prediction for 2N points? Exercise 6.6. Timing Quick Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points: Give times for two runs with 2N points: Estimate of time for 4N points: Give times for two runs with 4N points: Do you think the theoretical estimate was fairly accurate or not? Exercise 6.7. A mystery sort which algorithm did you choose? Merge sort or Heap sort) Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points assuming algorithm is (n): Estimate of time for 2N points assuming algorithm is on Lgn): Give times for two runs with 2N points: What do you believe is the most likely classification for this algorithm? Exercise 6.4. Timing Selection Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points: Give times for two runs with 2N points: Do you think the theoretical estimate was fairly accurate or not? Exercise 6.5. Timing Insertion Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points: Give times for two runs with 2N points: Do you think the theoretical estimate was fairly accurate or not? How well would doubling the time for N points work as a prediction for 2N points? Exercise 6.6. Timing Quick Sort Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points: Give times for two runs with 2N points: Estimate of time for 4N points: Give times for two runs with 4N points: Do you think the theoretical estimate was fairly accurate or not? Exercise 6.7. A mystery sort which algorithm did you choose? Merge sort or Heap sort) Smallest number of points that requires three seconds (N points): Give times for three runs with N points: Average time: Estimate of time for 2N points assuming algorithm is (n): Estimate of time for 2N points assuming algorithm is on Lgn): Give times for two runs with 2N points: What do you believe is the most likely classification for this algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
