Question: ( 5 marks ) A l and Bill are arguing about the performance of their sorting algorithms. Al claims that his O ( N l

(5 marks)Al and Bill are arguing about the performance of their sorting algorithms. Al claims that his O(NlogN)-time algorithm is always faster than Bill's O(N2)-time algorithm, where N is the input size. To settle the issue, they implement and run the two algorithms on many randomly generated data sets. To Al's dismay, they find that if N100 the O(N2)-time algorithm actually runs faster, and only when N100 the O(NlogN)-time one is better. Explain why the above scenario is possible. Give numerical examples.
 (5 marks)Al and Bill are arguing about the performance of their

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