Big O Algorithm Analysis
Big O Algorithm Analysis Using Code Snippets
In computer science, algorithm analysis determines the amount of resources (such as time and/or storage) necessary to execute that algorithm or program. Usually, the running time or efficiency of an algorithm is represented as a function relating the input size to the number of steps (time complexity) or storage locations (space complexity).
An important part of computational complexity theory is algorithm analysis. Analysis of algorithms gives us theoretical estimates for the resources that are needed by an algorithm to solve a problem. With these estimates we gain insight into efficient algorithms like sorting and searching.
Big O notation, Big-omega notation and Big-theta notation are asymptotic used in the theoretical analysis of algorithms, which is used to estimate the complexity of an algorithm for some arbitrarily large input size.
Let us take a look at some common running times and source code snippets below.