Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Same-fringe/PicoLisp/same-fringe-1.l
Normal file
19
Task/Same-fringe/PicoLisp/same-fringe-1.l
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(de nextLeaf (Rt Tree)
|
||||
(co Rt
|
||||
(recur (Tree)
|
||||
(when Tree
|
||||
(recurse (cadr Tree))
|
||||
(yield (car Tree))
|
||||
(recurse (cddr Tree)) ) ) ) )
|
||||
|
||||
(de cmpTrees (Tree1 Tree2)
|
||||
(prog1
|
||||
(use (Node1 Node2)
|
||||
(loop
|
||||
(setq
|
||||
Node1 (nextLeaf "rt1" Tree1)
|
||||
Node2 (nextLeaf "rt2" Tree2) )
|
||||
(T (nor Node1 Node2) T)
|
||||
(NIL (= Node1 Node2)) ) )
|
||||
(co "rt1")
|
||||
(co "rt2") ) )
|
||||
27
Task/Same-fringe/PicoLisp/same-fringe-2.l
Normal file
27
Task/Same-fringe/PicoLisp/same-fringe-2.l
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
: (balance '*Tree1 (range 1 7))
|
||||
-> NIL
|
||||
: (for N (5 4 6 3 7 1 2) (idx '*Tree2 N T))
|
||||
-> NIL
|
||||
|
||||
: (view *Tree1 T)
|
||||
7
|
||||
6
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
-> NIL
|
||||
|
||||
: (view *Tree2 T)
|
||||
7
|
||||
6
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
-> NIL
|
||||
|
||||
: (cmpTrees *Tree1 *Tree2)
|
||||
-> T
|
||||
Loading…
Add table
Add a link
Reference in a new issue