The Tower of Babel

Pattern Matching Example

read n,m,T1,T2,...,Tn,P1,P2,...,Pm
position <- 1
repeat until position > n - m + 1
4    if P1P2...Pm occurs at position in T1T2...Tnthen
5       write position
6    position <- position + 1
stop

 
[TOC][Next]

CS1104 Main Page
Last Updated 01/05/2000
© L.Heath, 2000