Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: A tree with exactly one infinite path
Replies: 8   Last Post: Aug 24, 2013 12:24 PM

 Messages: [ Previous | Next ]
 Graham Cooper Posts: 4,417 Registered: 5/20/10
Re: A tree with exactly one infinite path
Posted: Aug 22, 2013 4:53 AM

On Wednesday, August 21, 2013 9:09:43 PM UTC-7, 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

tail( cons(a,b) ) = b

They call this a list for some reason!

www.tinyurl.com/HOW-PROLOG-WORKS

Herc

Date Subject Author
8/22/13 Virgil
8/22/13 William Elliot
8/22/13 Graham Cooper
8/22/13 Tim Golden BandTech.com
8/22/13 LudovicoVan
8/22/13 Virgil
8/23/13 LudovicoVan
8/23/13 Virgil
8/24/13 fom