Information Technology Reference
In-Depth Information
Fig. 10.3 Example of literate code. The algorithm is explained and presented simultaneously. This
is the most verbose style, but, usually, the clearest. Note that this example is incomplete
LevelofDetail
Algorithms should be specified in sufficient detail to allow them to be implemented
without undue inventiveness.
5. (Matching.) For each pair of strings s
S , find N s , t , the maxi-
mum number of non-overlapping substrings that s and t have in
common.
,
t
The way in which a step of this kind is implemented may greatly affect the behaviour
of the final algorithm, so the matching process needs to be made explicit.
But don't provide too much detail. For example, loops are sometimes used unnec-
essarily in specification of algorithms.
 
Search WWH ::




Custom Search