Recursive breadth first tree traversal

Posted by dugogota on Stack Overflow See other posts from Stack Overflow or by dugogota
Published on 2010-05-03T03:08:08Z Indexed on 2010/05/03 3:18 UTC
Read the original article Hit count: 362

Filed under:
|
|
|

I'm pulling my hair out trying to figure out how to implement breadth first tree traversal in scheme. I've done it in Java and C++. If I had code, I'd post it but I'm not sure how exactly to begin.

Given the tree definition below, how to implement breadth first search using recursion?

(define tree1 '( A ( B (C () ()) (D () ()) ) (E (F () ()) (G () ())) ))

Any help, any, is greatly appreciated.

© Stack Overflow or respective owner

Related posts about Scheme

Related posts about plt-scheme