The Marriage of Theory and Practice
This section introduces two techniques for providing efficiency information on algorithms. The first technique is a theoretical description of the complexity of an algorithm, the O(n) notation. It can be used to compare the merits of underlying concepts of algorithms. This can be done without doing any implementation. The second technique introduced in this section is a timing function that can be used to time implemented code. It is used throughout this book to time suggested coding solutions.
Algorithm Complexity (the O Notation)
The O notation is used to compare the efficiency of different algorithms. This notation expresses the mathematical complexity of an algorithm. It tells you, for example, how the ...
Get C++ Footprint and Performance Optimization now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.