 in computer science, the analysis of algorithms is the determination of the amount of resources (such as time and storage) necessary to execute them. most algorithms are designed to work with inputs of arbitrary length. usually, the efficiency or running time of an algorithm is stated as a function relating the input length to the number of steps (time complexity) or storage locations (space complexity). algorithm analysis is an important part of a broader computational complexity theory, which provides theoretical estimates for the resources needed by any algorithm which solves a given computational problem. these estimates provide an insight into reasonable directions of search for efficient algorithms. in theoretical analysis of algorithms it is common to estimate their complexity in the asymptotic sense, i.e., to estimate the complexity function for arbitrarily large input. big o notation, big-omega notation and big-theta notation are used to this end. for instance, binary search is said to run in a number of steps proportional to the logarithm of the length of the list being searched, or in o(log(n)), colloquially "in logarithmic time". usually asymptotic estimates are used because different implementations of the same algorithm may differ in efficiency. however the efficiencies of any two "reasonable" implementations of a given algorithm are related by a constant multiplicative factor called a hidden constant. exact (not asymptotic) measures of efficiency can sometimes be computed but they usually require certain assumptions concerning the particular implementation of the algorithm, called model of computation. a model of computation may be defined in terms of an abstract computer, e.g., turing machine, and/or by postulating that certain operations are executed in unit time. for example, if the sorted list to which we apply binary search has n elements, and we can guarantee that each lookup of an element in the list can be done in unit time, then at most log2 n + 1 time units are needed to return an answer. == cost models == time efficiency estimates depend on what we define to be a step. for the analysis to correspond usefully to the actual execution time, the time required to perform a step must be guaranteed to be bounded above by a constant. one must be careful here; for instance, some analyses count an addition of two numbers as one step. this assumption may not be warranted in certain contexts. for example, if the numbers involved in a computation may be arbitrarily large, the time required by a single addition can no longer be assumed to be constant. two cost models are generally used:{{cite book|author1=alfred v. aho|author2=john e. hopcroft|author3=jeffrey d. ullman|title=the design and analysis of computer algorithms|
Analysis_of_algorithms Computational_complexity_theory