(b) A sorting algorithm is in O(n^(2)) in the worst case. It takes 2 seconds to sort...
Fantastic news! We've Found the answer you've been seeking!
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 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?
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date: