Page 1 of 1

tree in-order

Posted: Sat Dec 17, 2011 5:26 am
by doot
I have a tree of type (2)
A
/ \
B C
/ \
D E

I have this function which returns my nods in post-order
(defun postordine(l)
(cond
((null l) l)
(t (append (postordine (car (cdr l))) (postordine (car (cdr (cdr l)))) (list(car l))))
)
)


I need to change it for a in-order
any help ? :] or link to some tutorials

Re: tree in-order

Posted: Mon Dec 19, 2011 4:17 pm
by Konfusius
Just reorder the arguments to append.