Leaf Branch Tree Forest: Difference between revisions

From XPUB & Lens-Based wiki
(New page: Trees are often used in computer science as examples -- "tree" in fact can refer to a specific kind of data structure. One interesting approach to trees from a computer science perspective...)
 
No edit summary
 
Line 1: Line 1:
Trees are often used in computer science as examples -- "tree" in fact can refer to a specific kind of data structure. One interesting approach to trees from a computer science perspective, is as a hierarchy of structures.
Trees are often used in computer science as examples -- "tree" in fact can refer to a specific kind of data structure. One interesting approach to trees from a computer science perspective, is as a hierarchy of structures.
The tree itself is made of branches, and each branch eventually contains leaves.
The tree itself is made of branches, and each branch eventually contains leaves. At a larger scale still, a forest could be said to be "made of trees".


In a pair, create first a set of primitives, starting with ''leaf'', then ''branch'', then ''tree'', then ''forest''. In each case, write each function to use the preceding one you defined (so branch uses leaf, tree uses branch, forest uses tree). Try to write the functions in as simple and straightforward a way as possible as your first priority is to complete each step of the hierarchy. Once this is done, focus on refining a specific element (say the leaves or then branch). If you like you can now work independently on different parts.
In a pair, create first a set of primitives, starting with ''leaf'', then ''branch'', then ''tree'', then ''forest''. In each case, write each function to use the preceding one you defined (so branch uses leaf, tree uses branch, forest uses tree). Try to write the functions in as simple and straightforward a way as possible as your first priority is to complete each step of the hierarchy. Once this is done, focus on refining a specific element (say the leaves or then branch). If you like you can now work independently on different parts.

Latest revision as of 15:39, 28 October 2008

Trees are often used in computer science as examples -- "tree" in fact can refer to a specific kind of data structure. One interesting approach to trees from a computer science perspective, is as a hierarchy of structures. The tree itself is made of branches, and each branch eventually contains leaves. At a larger scale still, a forest could be said to be "made of trees".

In a pair, create first a set of primitives, starting with leaf, then branch, then tree, then forest. In each case, write each function to use the preceding one you defined (so branch uses leaf, tree uses branch, forest uses tree). Try to write the functions in as simple and straightforward a way as possible as your first priority is to complete each step of the hierarchy. Once this is done, focus on refining a specific element (say the leaves or then branch). If you like you can now work independently on different parts.