next up previous contents
Next: Sharing nodes Up: Recursive Pointer Based Data Previous: Recursive Pointer Based Data

Nested recursive structures

In its most general form, the structure would be defined as in fig. 2.2. Each type of structure could potentially store a different type of data. These definitions would allow us to describe nested structures such as lists of lists, trees of lists and trees of trees.


 
Figure 2.2:   A more general recursive structure
\begin{figure}
\begin{verbatim}
class RecStruct[1] {

 Data[1] value;
 RecStruct...
 ...RecStruct[3] *dir[2];

 ...

 RecStruct[k] *dir[k-1]
}\end{verbatim}\end{figure}



Timothy Lewis
11/12/1997