Question: (b) A sorting algorithm is in O(n^(2)) in the worst case. It takes 2 seconds to sort 10,000 records, i.e. n=10,000. (i) What is the

(b) A sorting algorithm is in O(n^(2)) in the worst case. It takes 2 seconds to sort 10,000 records, i.e. n=10,000. (i) What is the predicted time for the algorithm to sort 20,000 records? [2 marks] (ii) Suppose that you are presented with a machine that is 100 times as fast. How many records will you be able to process on the new machine in 4 seconds? 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Given that the sorting algorithm is On2 in the worst case and takes 2 seconds to sort 10000 record... View full answer

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!