A
A
allaga2019-10-13 13:54:50
Algorithms
allaga, 2019-10-13 13:54:50

Does the number of steps in the algorithm affect the speed?

Good evening!
I am quite new to programming and would like to ask a question about compiling an algorithm. I will give a comparative example: the teacher asked Vasya Pupkin to bring chalk from the teacher's room and wet the sponge for the blackboard (the sink is in the corridor). Imagine figuratively that the teacher asked Vasya an algorithm of actions. Estimated time to complete the tasks 10 minutes. And if the chalk was in the teacher's pedestal, and the sink would be inside the classroom, the whole thing would take about 1-2 minutes. Is this also the case in programming? Does the number of steps affect the performance of the algorithm?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Slavik KENNY, 2019-10-13
@allaga

If it is very simple to answer - it does.
But no less influences what these steps are (time to perform one operation), and situations are quite possible where a smaller number of slower steps will lose in speed to an algorithm with a large number of actions, but which are performed much faster.
And the program can be executed in several threads - it is even more difficult to say which option will turn out faster.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question