Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLease answer the question in python. CODE IT IN PYTHON 2) (10 pts) Merge Sort vs Insertion Sort Running time analysis Modify code-Now that you
PLease answer the question in python. CODE IT IN PYTHON
2) (10 pts) Merge Sort vs Insertion Sort Running time analysis Modify code-Now that you have verified that your code runs correctly using the data.txt input file, you can modify the code to collect running time data. Instead of reading arrays from the file data.txt and sorting, you will now generate arrays of size n containing random integer values from 0 to 10,000 to sort. Use the system clock to record the running times of each algorithm for ten different values of n for example: n = 5000, 10000, 15000, 20,000, 50,000. You may need to modify the values of n if an algorithm runs too fast or too slow to collect the running time data (do not collect times over a minute). Output to the terminal the array size n and time to sort. Name these new programs insertTime and mergeTime. In your write up submitted to Canvas explain how you modified your code to collect running times. Submit the code to TEACH
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started