How to print a binary tree of functions/terminals like a lisp statement?

Posted by sieve411 on Stack Overflow See other posts from Stack Overflow or by sieve411
Published on 2010-03-28T23:21:03Z Indexed on 2010/03/28 23:23 UTC
Read the original article Hit count: 276

Filed under:
|

I have a binary tree of functions and terminal values. I'd like to print this tree as a lisp statement would be represented!

For example, a tree with just a root of "+" and terminals of "2" and 4" would read (+ (2 4)).

© Stack Overflow or respective owner

Related posts about binary-trees

Related posts about java