Tree modeling

Mickael Remond mikl@REDACTED
Thu Jul 13 10:39:23 CEST 2000


How would you write an insert function to add child to a tree structure
represented like that:

{id, name, [child]}

For example: 
{1, "test1", [
    {2, "test2", []},
    {3, "test3", [
            {4, "test4", []}]},
    {5, "test5", []]}

I did not figure out how to scan/walk this tree with recursive functions.
It will be easy if it was a binary tree, but this is not the case...

-- 
Mickaël



More information about the erlang-questions mailing list