That’s why we employ worst-case scenarios to get meaningful input. The best-case scenario usually tells us nothing - we'll possibly solve the problem on the first try. The space complexity of a function measures the amount of memory your code uses.įor a quick refresher on everything around Big O notation, keep reading this cheat sheet! BASIC LEVEL - Big O Notation Cheat Sheet What is Big O?īig O is also known as the algorithm's upper bound since it analyses the worst-case situation. Now, time complexity and space complexity are two specific techniques to measure efficiency.Ī function's time complexity measures how long it takes to execute in terms of computational steps. This Big O Notation cheat sheet is here to make these concepts easier for you. You can also see it as a way to measure how effectively your code scales as your input size increases. Put simply, it gives an estimate of how long it takes your code to run on different sets of inputs. Big O Notation is a metric for determining an algorithm's efficiency.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |