D
D
Denis2020-01-10 21:23:22
Programming
Denis, 2020-01-10 21:23:22

How to solve the problem on the complexity of the algorithms below?

Hello, help me decide:
Computer A is 100 times faster than computer B. If computer B processes n-th amount of input data in 1 hour with an algorithm with linear complexity, then how much data will computer A process in the same time if the complexity of the processing algorithm is:
a) Linear (n)
b) Quadratic (n^2)
c) Cubic (n^3)
d) Exponential (2^n)
Do I understand correctly:
a) 100n
b) 10n
c) Cubic root of 100n (4.64159n)
d )log(2)100n (6.644n)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2020-01-11
@DeiP

d) incorrectly calculated.
Write an equation. Here you have a time function for n inputs f(n) on computer B. On computer A, the execution time will be - f(n)/100, because it is 100 times faster.
Now let x be the amount of data on computer A that needs to be found. Then you have f(x)/100 = f(n). Substitute the desired function for f() and find x. Spoiler, it will be similar, but not what you have in the question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question