O'Reilly logo

Programming Pearls, Second Edition by Jon Bentley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hints for Selected Problems

Column 1

4. Read Column 12.

5. Consider a two-pass algorithm.

6, 8, 9. Try key indexing.

10. Consider hashing, and don’t limit yourself to a computerized system.

11. This problem is for the birds.

12. How do you write without using a pen?

Column 2

1. Think about sorting, binary search and signatures.

2. Strive for an algorithm that runs in linear time.

5. Exploit the identity cba = (arbrcr)r.

7. Vyssotsky used a system utility and two one-shot programs that he wrote just for this job to rearrange data on tapes.

8. Consider the k smallest elements in the set.

9. The cost of s sequential searches is proportional to sn; the total cost of s binary searches is the cost of the searches plus the time required to sort ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required