Identifying Runtime Complexity
Runtime complexity is a term that we use to describe how performance an algorithm is.
We use runtime complexity to compare different solutions to a given problem or different algorithms.
Our goal is to make sure that we have the ability to identifty a given runtime complexity.
How much more processing power/time is require to run your algorithm if we double the inputs?
Some tips right here (in the next image) on some common complexities and how yo can identifiy them:
Big ‘O’ Notation is another way of referencing runtime complexity.
What is the runtime complexity of your solution?
What is the big O of your solution?
They are both asking what is the efficiency of your solution?
In this repository we can see that each problem has several solutions:
Examples of quadratic runtime or N^2.
Two nested for loops iterating over the same collection
In case of two nested for loops iterating over different collections we are talking about O(n*m) nor O(n²).
Dejar un comentario
¿Quieres unirte a la conversación?Siéntete libre de contribuir!