What does Big-O Notation Sound Like?
Understanding time and space complexity is important when choosing between different algorithms. Time complexity is the amount of time an algorithm takes based on the length of the input. Space complexity is how much memory an algorithm requires based on the size of the input. Technically, there are worst case, average case, and best case scenarios for analyzing algorithms, but we typically consider the worst case scenarios. For worst case scenarios, we calculate the upper bound on the running time of an algorithm or the memory requirements. Big-O notation only considers the dominant term in the running time equation.
Read more