Comparing Runtimes
In this lesson, we'll compare solutions with different runtimes.
We'll cover the following...
Visualizing runtimes #
How does the above chart help me?
When competing in contests, your solution is given a fixed time of a few seconds to execute and produce the correct output. The time taken to execute is directly dependent on the number of operations your algorithm performs. Hopefully this chart helps you understand how different runtimes grow in the number of operations with growing N relative to each other.
Is my solution going to run in time?
The actual answer will depend on a number of factors like hidden constants, allowed execution time, and the server where the code is executed.
Nevertheless, below is a general rule of thumb to determine whether your solution is going to ...
Create a free account to view this lesson.
By signing up, you agree to Educative's Terms of Service and Privacy Policy