Algorithms in a Nutshell

(Tina Meador) #1
Design Format | 43

Patterns and
Domains

You should refer first to the fact sheet and use it as a reference when reading the
provided source code implementations. Within the fact sheet, a small example is
used to better explain the execution of the algorithm. In general, to show the
dynamic behavior of the algorithms, the individual steps of the example are
shown vertically in sequence, representing time moving “downward” on the fact
sheet.

Design Format


We provide a set of UML class diagrams for solutions that are coded in Java or
C++. These diagrams are a helpful aid to understanding code that takes advan-
tage of class inheritance and polymorphism. Figure 3-3 contains a sample class
diagram showing the relationship between a superclassSegmentTreeNodeand two
subclasses, DefaultSegmentTreeNode and StoredIntervalsNode, that extend
SegmentTreeNodeusing inheritance (as identified by the arrows terminating in
triangles). Each class box has two parts: the upper part lists instance variables,
and the lower part lists instance methods. The leading symbols for each declared
attribute or method are significant:

Figure 3-2. Glyphs for identifying algorithmic concepts

Algorithms in a Nutshell
Algorithms in a Nutshell By Gary Pollice, George T. Heineman, Stanley Selkow ISBN:
9780596516246 Publisher: O'Reilly Media, Inc.


Prepared for Ming Yi, Safari ID: [email protected]
Licensed by Ming Yi
Print Publication Date: 2008/10/21 User number: 594243
© 2009 Safari Books Online, LLC. This PDF is made available for personal use only during the relevant subscription term, subject to the Safari Terms of Service. Any other use


Licensed by


Ming Yi

Free download pdf