
Re: A tree with exactly one infinite path
Posted:
Aug 22, 2013 4:53 AM


On Wednesday, August 21, 2013 9:09:43 PM UTC7, Virgil wrote: > Consider the binary tree in which every right child has a child and > > every left child is a terminal node. > > > > Then there is in it for each member of N a left terminal node having > > that path length, and an infinite path of all right nodes to represent > > the set N itself, having one node at each length in N. > >
Welcome to Functional Programming!
cons_node  cons_nodes consist of two pointers, one to the head (first item) the other to the rest of the list. They are the "glue" which holds the list together. The list (A B C) would be stored as     . . >  . . >  . . > NIL       V V V A B C
head( cons(a,b) ) = a tail( cons(a,b) ) = b
They call this a list for some reason!
www.tinyurl.com/HOWPROLOGWORKS
Herc

