Anonymous user
Same fringe: Difference between revisions
→{{header|Scheme}}: reword & example
(→version 1.1: +Scheme version) |
(→{{header|Scheme}}: reword & example) |
||
Line 1,768:
=={{header|Scheme}}==
Descend provides a list, or stack, of the
<lang Scheme>; binary tree helpers from "Structure and Interpretation of Computer Programs" 2.3.3
Line 1,801:
(cond
((and (null? l1) (null? l2)) #t)
((
(next (ascend l1) (ascend l2)))
(else #f))))</lang>
{{out}}
<pre>> (same-fringe? (list 1 '() (list 2 '() (list 3 '() '()))) (list 3 (list 2 (list 1 '() '()) '()) '()))
#t</pre>
=={{header|Tcl}}==
|