Question: with identical random doubles between 0 and 1 . Sort one array using bubble sort, and theother using merge sort ( both of which you

with identical random doubles between 0 and 1. Sort one array using bubble sort, and theother using merge sort (both of which you must implement). Time each execution and print theresult. If it takes longer than 20 seconds, stop executing and report the fact. If you run out ofmemory, stop executing and report the fact. Exception handling will help here dont let yourprogram crash or run for hours.Your program should do this over and over until you either run out of memory or neither sortfinishes within twenty seconds. Start n out at ten, and multiply by 10 each time, so youre testingthe algorithm at n =10,100,1000,10000, etc.Write a couple of lines in the codes comments discussing the running time difference betweenO(n2) and O(n log n) sorting methods.2

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 Programming Questions!