Skip to Content
Algorithms in a Nutshell, 2nd Edition
book

Algorithms in a Nutshell, 2nd Edition

by George T. Heineman, Gary Pollice, Stanley Selkow
December 2015
Intermediate to advanced
350 pages
10h 31m
English
O'Reilly Media, Inc.
Content preview from Algorithms in a Nutshell, 2nd Edition

Appendix A. Benchmarking

Each algorithm in this book is accompanied by data about its performance. Because it’s important to use the right benchmarks to get accurate performance, we present our infrastructure to evaluate algorithm performance in this appendix. This should also help to address any questions or doubts you might have concerning the validity of our approach. We try to explain the precise means by which empirical data is computed, in order to enable you both to verify that the results are accurate and to understand where the assumptions are appropriate given the context in which the algorithm is intended to be used.

There are numerous ways by which algorithms can be analyzed. Chapter 2 presented a theoretical, formal treatment, introducing the concepts of worst-case and average-case analysis. These theoretic results can be empirically evaluated in some cases, but not all. For example, consider evaluating the performance of an algorithm to sort 20 numbers. There are 2.43*1018 permutations of these 20 numbers, and we cannot simply exhaustively evaluate each of these permutations to compute the average case. Additionally, we cannot compute the average by measuring the time to sort all of these permutations. We must rely on statistical measures to assure ourselves we have properly computed the expected performance time of the algorithm.

Statistical Foundation

This chapter focuses on essential points for evaluating the performance of algorithms. Interested readers should ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Algorithms, 4th Edition

Algorithms, 4th Edition

Robert Sedgewick, Kevin Wayne
Learning Algorithms

Learning Algorithms

George Heineman
Dive Into Algorithms

Dive Into Algorithms

Bradford Tuckfield
Algorithms in a Nutshell

Algorithms in a Nutshell

George T. Heineman, Gary Pollice, Stanley Selkow

Publisher Resources

ISBN: 9781491912973Errata Page