1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Xelga [282]
3 years ago
13

2) An algorithm that takes in as input an array with n rows and m columns has a run time of O(nlgm). The algorithm takes 173 ms

to run in an input array with 1000 rows and 512 columns. How long will the algorithm take to run on an input array with 1500 rows and 4096 columns? (Note: For ease of calculation, please use a base of 2 for your logarithm.)
Computers and Technology
1 answer:
mr Goodwill [35]3 years ago
8 0

Answer:

The algorithm takes 346 ms to run on an input array with 1500 rows and 4096 columns.

Explanation:

For an input array with 1000 rows and 512 columns, the algorithm takes 173 ms.

We want to find out how long will the algorithm take to run on an input array with 1500 rows and 4096 columns?

Let the algorithm take x ms to run 1500 rows and 4096 columns.

For an input of n rows and m columns, it takes

n \: log_{2} \:m

So,

1000 \: log_{2} \:512 = 173  \\\\1000 \: log_{2} \:2^{9}  = 173 \:\:\: ( 2^{9} = 512)  \\\\1000 \times 9  = 173 \:\:\:\:\: \: \: eg. 1

and

1500 \: log_{2} \:4096 = x  \\\\1500 \: log_{2} \:2^{12}  = x \:\:\: ( 2^{12} = 4096)  \\\\1500 \times 12  = x \:\:\:\:\: \: \: eg. 2

Now divide the eq. 2 by eq. 1 to find the value of x

\frac{1500 \times 12}{1000 \times 9}   = \frac{x}{173}  \\\\\frac{18000 }{9000}   = \frac{x}{173}  \\\\2   = \frac{x}{173}  \\\\x = 2 \times 173 \\\\x = 346 \: ms

Therefore, the algorithm takes 346 ms to run on an input array with 1500 rows and 4096 columns.

You might be interested in
Describe two measures you can use to evaluate whether an attachment in a message is reliable to open.
meriva
<span>If a attachment is not reliable to open, terrible effects can happen, peradventure it may have a virus or even malware that can destroy a computers software. 

To avoid this and stay on the safe side, try the following:-

- Open it in protected view 
- Do not save the attachment on your computer 
- Look at the author and read the message carefully to make sure it is not biased. 
- Open it on a flash-drive </span>
8 0
3 years ago
Read 2 more answers
Which statement will call this module and pass 12 as the argument?
WITCHER [35]

Answer:

Call showValue (12)

Explanation:

The function is a block of the statement which performs the special task.

if you define the function, then you have to call that function.

Then, program control moves to the function and start to execute otherwise not execute the function.

the syntax for calling the function:

name(argument_1, argument_2,....);

we can put any number of arguments in the calling.

check the options one by one for finding the answer:

Call showValue( Integer): this is valid calling but it passes the variable, not the 12. this is not correct.

Call showValue( Integer 12): This is not valid calling, because it passes the data type as well which is incorrect.

Call showValue( Real): this is valid calling but it passes the variable, not the 12. this is not correct.

Call showValue (12): this valid calling and also pass the value 12.

Therefore, the correct answer is option b.

6 0
3 years ago
Kim agrees. You get the equipment from the truck and begin working. Kim approaches you as you are installing the modem and is a
Angelina_Jolie [31]
Ask your friends if they are doing something wrong with your friends and friends
6 0
2 years ago
What are events in computer programming?
N76 [4]

Answer:

mnkn

Explanation:

3 0
3 years ago
Read 2 more answers
Draw a flowchart that ask the user to enter number: if the number is less than then 10 number it is doubled if the number is mor
solong [7]

Answer:

please find the attachment of the flowchart.

Explanation:

In this question, a start block is used to start the program, in the parallelogram box we input the value from the user end and in the diamond box, we check the input is not equal to 0. In the next diamond box, it checks the given input value and print value, and at the last, we stop the code.

Please find the program and its output in the attached file.

8 0
3 years ago
Other questions:
  • If i throw papers in the dryer to help them dry faster could that mess up the dryer?
    5·1 answer
  • Enlist the various data analysis methods for study of Infrasonic waves, Seismic waves, Earthquake prone areas and how AI can be
    15·1 answer
  • Whats the answer to this question?
    7·1 answer
  • PLEASE HELP!! Kou converged his Word document to a PowerPoint document. When he received the PowerPoint, he was missing material
    12·1 answer
  • Write an assembly program that will prompt the user for 3 inputs (let’s abstractly call them a, b, and c) without a leading stri
    13·1 answer
  • A blue NFiPA label indicates: A) Health Hazard B) Special information C) Flammability D) Reactivity
    6·2 answers
  • Each of the outcomes listed below is a result of executing the following script except for one. Which one? CREATE ROLE ExampleRo
    6·1 answer
  • Which of the following are input devices? Check all that apply.
    9·2 answers
  • What is required to become a good critical thinker? Use a process when dealing with a big issue. Practice the right skills over
    9·1 answer
  • Write a while loop that continues to increment uservalue by 5 as long as uservalue is less than 0.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!