Abstract

When first introduced to the analysis of algorithms, students are taught how to assess the best and worst cases, whereas the mean and amortized costs are considered advanced top- ics, usually saved for graduates. When presenting the latter, aggregate analysis is explained first because it is the most intuitive kind of amortized analysis, often involving enumerative combina- torics. We show how the aggregate analysis of functional queues can be carried out accurately and graphically, without combinatorics nor analytical tools like asymptotics, hence making it amenable to undergraduates. Our presentation is independent of any programming language.

Highlights

  • The branch of theoretical computer science devoted to the mathematical study of the efficiency of programs has been pioneered by Donald Knuth, who named it analysis of algorithms (Knuth, 1997, 2000; Sedgewick and Flajolet, 1996)

  • When sorting objects, called keys, by comparing them, the input size is the number of keys and the abstract unit of time is often one comparison, so the cost is the mathematical function which associates the number of objects and the number of comparisons to sort them

  • The cost varies depending on the algorithm and it often depends on the original partial ordering of the keys, so, for a given procedure, the size does not capture all the aspects needed to assess efficiency. This quite naturally leads to consider bounds on the cost: for a given input size, the minimum cost is the cost of the configurations leading to the smallest possible cost, or best case; the maximum cost corresponds to the worst case

Read more

Summary

Analysis of Algorithms

The branch of theoretical computer science devoted to the mathematical study of the efficiency of programs has been pioneered by Donald Knuth, who named it analysis of algorithms (Knuth, 1997, 2000; Sedgewick and Flajolet, 1996). The cost varies depending on the algorithm and it often depends on the original partial ordering of the keys, so, for a given procedure, the size does not capture all the aspects needed to assess efficiency This quite naturally leads to consider bounds on the cost: for a given input size, the minimum cost is the cost of the configurations leading to the smallest possible cost, or best case; the maximum cost corresponds to the worst case. Instead, amortized analysis (Okasaki, 1998; Cormen et al, 2009, §17) takes into account the interactions between updates, so a lower maximum bound on the cost is derived Note that this kind of analysis is inherently different from the average case analysis, as its object is the composition of different functions instead of independent calls to the same function on different inputs. We propose to extend its scope by showing a compelling case study on functional queues

Functional Queues
Conclusion
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call