Programming PearlsJust as natural pearls grow from grains of sand that irritate oysters, programming pearls have grown from real problems that have irritated real programmers. With origins beyond solid engineering, in the realm of insight and creativity, Bentley's pearls offer solutions to those nagging problems. Illustrated by programs designed as much for fun as for instruction, the book is filled with lucid and witty descriptions of practical programming techniques and fundamental design principles. In this revision, Bentley has substantially updated his essays to reflect current programming methods and environments. In addition, there are three new essays on  testing, debugging, and timing, set representations, string problems. All the original programs have been rewritten, and an equal amount of new code has been generated. Implementations of all the programs, in C or C++, are available on the Web. 
What people are saying  Write a review
User ratings
5 stars 
 
4 stars 
 
3 stars 
 
2 stars 
 
1 star 

User Review  Flag as inappropriate
A cross between a style book and an algorithms book.
User Review  Flag as inappropriate
I actually read the first edition of this book and therefore this review is about it. The point of this book is to teach people how to think about programs, in particular to make them more efficient. I think this is a good book for helping people to understand what programming is all about.
Contents
Cracking the Oyster  3 
Aha Algorithms  11 
Data Structures Programs  21 
Writing Correct Programs  33 
A Small Matter of Programming  45 
PERFORMANCE  59 
Perspective on Performance  61 
The Back of the Envelope  67 
Searching  133 
Heaps  147 
Strings of Pearls  161 
Epilog to the First Edition  175 
Epilog to the Second Edition  177 
A Catalog of Algorithms  179 
An Estimation Quiz  183 
Cost Models for Time and Space  185 
Algorithm Design Techniques  77 
Code Tuning  87 
Squeezing Space  99 
THE PRODUCT  113 
Sorting  115 
A Sample Problem  125 
Rules for Code Tuning  191 
C++ Classes for Searching  197 
Hints for Selected Problems  201 
Solutions to Selected Problems  205 
233  
Common terms and phrases
0(n log ahout allocation anagram assertion average binary search trees bugs bytes cache code tuning contains correct cost data structure define describes dictionary digits disk edition efficient element factor faster function Further Reading gram hash table heap property heap(l Heapsort hook implementation initialize input file Insertion Sort integers interface invariant iteration Knuth lines of code linked lists Little's Law log n1 machine main memory malloc maximum maxval megabytes nanoseconds node operations output percent performance pointers priority queues problem program verification pseudocode Quicksort random integers range recursive reduced replace represent scaffolding Section sentinel sequence sequential search shows simple Solutions for Column solve sorting algorithms space speedup Standard Template Library statement string suffix array suharray suhvector swap tahle techniques tion variable vector void insert(t words write zero