Convert tree to list

Convert a tree to a list.

Convert a tree to a list.

Date Created:Friday October 03rd, 2008 06:20 PM
Date Modified:Friday October 03rd, 2008 06:21 PM

(define datum car)

(define children cdr)

(define (listify-tree tree)
    (cons (datum tree) (listify-tree-map (children tree))))

(define (listify-tree-map children)
    (if (null? children)
          (listify-tree (car children))
          (list-tree-map (cdr children))

Download: listify-tree.scm 334 B

Please login or Click Here to register for downloads
Creative Commons License
Convert tree to list by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at
Permissions beyond the scope of this license may be available at