CHAPTER 8

image

Tangled Dependencies and Memoization

Twice, adv. Once too often.

— Ambrose Bierce, The Devil’s Dictionary

Many of you may know the year 1957 as the birth year of programming languages.1 For algorists, a possibly even more significant event took place this year: Richard Bellman published his groundbreaking book Dynamic Programming. Although Bellman’s book is mostly mathematical in nature, not really aimed at programmers at all (perhaps understandable, given the timing), the core ideas behind his techniques have laid the foundation for a host of very powerful algorithms, and they form a solid design method that any algorithm designer ...

Get Python Algorithms: Mastering Basic Algorithms in the Python Language, Second Edition 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.