Hello!

I wonder

Why is the speed of the algorithm is measured in number of operations, not in seconds?

Isn't it possible that some small program runs faster than the two line feature(built-in)?

I wonder

Why is the speed of the algorithm is measured in number of operations, not in seconds?

Isn't it possible that some small program runs faster than the two line feature(built-in)?

asked April 3rd 20 at 18:29

2 answers

answered on

Solution

And that will give you seconds?

Here you have two programs that process the same data and receive the same results by different algorithms. The first program does it for 10 seconds, the second for 20. How to estimate how much it will increase the processing time by increasing the volume of data 10 times?

No, we do not know the complexity of the algorithm. If the first has a complexity of O(n^{2}) and the second is O(n), the time of the first will grow 100 times and will be 1000 seconds, and the second only 10 times (200 seconds). That is, a program that was faster on small dataset suddenly becomes much slower on a large set. And the most important parameter here is the computation complexity of the algorithm.

Here you have two programs that process the same data and receive the same results by different algorithms. The first program does it for 10 seconds, the second for 20. How to estimate how much it will increase the processing time by increasing the volume of data 10 times?

No, we do not know the complexity of the algorithm. If the first has a complexity of O(n

answered on April 3rd 20 at 18:33

Because the execution speed depends on the frequency and type of the processor, and in our time, and the number of cores/processors (threads).

Find more questions by tags Algorithms

But could you bring some examples - lonny_Pagac79 commented on April 3rd 20 at 18:34

there is a little bit explained

briefly:

- Hayden commented on April 3rd 20 at 18:37