High Level Language Programming

 

Procedural Abstraction

 

Recall this pseudocode version of Pattern Matching:

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

If C++ had a built-in operation for the read in line 1 and for the check in line 4, then we could write a C++ program directly from this version. C++ does not, but we can build our own as procedures.

 

[Prev][TOC][Next]


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