Algorithm Pattern Format

Each algorithm is presented using the following pattern sections:

Name

A descriptive name for the algorithm. We use this name to communicate concisely the algorithm to others. For example, if we talk about using a Sequential Search, it conveys exactly what type of search algorithm we are talking about. The name of each algorithm is always shown in Small Caps; all words typeset this way in this book refer to an algorithm.

Synopsis

A high-level description of the algorithm and what it is designed to do.

Context

A description of a problem that illustrates the "sweet spot" for the algorithm.

Forces

A description of the properties of the problem/solution that must be addressed and maintained for a successful implementation. They are the things that would cause you to choose this algorithm specifically.

Solution

The algorithm description using real working code with documentation. Where appropriate, UML class diagrams are also included.

Consequences

Identifies and discusses the advantages/disadvantages and anti-patterns for this algorithm.

Analysis

A synopsis of the analysis of the algorithm, including performance data as well as other data that helps the reader understand the behavior of the algorithm. Although the analysis section is not meant to "prove" the described performance of an algorithm, readers should be able to understand why the algorithm behaves as it does. We will provide references to actual texts that present the appropriate lemmas and proofs ...

Get Algorithms in a Nutshell 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.