FP Laboratory 11
Jump to navigation
Jump to search
Binary Trees
- Create a data type that defines binary tree where values are stored in leaves and also in branches.
- Prepare an example of a binary tree.
- Create a function that counts the values stored in the leaves.
- Create a function that extracts all values from the leaves into na list.
- One possibility how to represent a tree in a textual form is
a(b(d,e),c(,f(g,)))
. Create functions that are able to read and store a tree in such a notation.