  in computer science, amortized analysis is a method of analyzing algorithms that considers the entire sequence of operations of the program. it allows for the establishment of a worst-case bound for the performance of an algorithm irrespective of the inputs by looking at all of the operations. this analysis is most commonly discussed using big o notation. at the heart of the method is the idea that while certain operations may be extremely costly in resources, they cannot occur at a high enough frequency to weigh down the entire program because the number of less costly operations will far outnumber the costly ones in the long run, "paying back" the program over a number of iterations. it is particularly useful because it defines the worst-case limit of a program's performance rather than making assumptions about the state of the program. ==history== amortized analysis initially emerged from a method called aggregate analysis, which is now subsumed by amortized analysis. however, the technique was first formally introduced by robert tarjan in his 1985 paper amortized computational complexity, which addressed the need for more useful form of analysis than the common probabilistic methods used. amortization was initially used for very specific types of algorithms, particularly those involving binary trees and union operations. however, it is now ubiquitous and comes into play when analyzing many other algorithms as well. ==method==  the method requires knowledge of which series of operations are possible. this is most commonly the case with data structures, which have state that persists between operations. the basic idea is that a worst case operation can alter the state in such a way that the worst case cannot occur again for a long time, thus "amortizing" its cost. there are generally three methods for performing amortized analysis: the aggregate method, the accounting method, and the potential method. all of these give the same answers, and their usage difference is primarily circumstantial and due to individual preference. *aggregate analysis determines the upper bound t(n) on the total cost of a sequence of n operations, then calculates the amortized cost to be t(n) / n. *the accounting method determines the individual cost of each operation, combining its immediate exec
Analysis_of_algorithms