Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. A certain linear desktop PC r algorithm takes 2 seconds to process with an input size of -1000 on an old a) How long

image text in transcribed
4. A certain linear desktop PC r algorithm takes 2 seconds to process with an input size of -1000 on an old a) How long would it take if n-2000? b) How long would it take for-2000 if the algorithm were 0(r) instead of linear? c) How long would it take for n-2000 if the algorithm were O(r) instead of linear? 5. A programmer plans to use a sort algorithm known to be O(n). The project manager states that the algorithm is OK if it will sort 2,000 records in less than one second on the target machine. The programmer does a simple test, and finds that it takes 10 milliseconds to sort 100 records Is the algorithm fast enough? A programmer is writing a binary search algorithm for use on an ordered array that will range in size from 1,000,000 to 10,000,000 records 6. a) What is the number of comparisons done in the worst case? b) What is the number of comparisons done in the best case? 234

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions