projects
/
lambda.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tweak advanced
[lambda.git]
/
miscellaneous_lambda_challenges_and_advanced_topics.mdwn
diff --git
a/miscellaneous_lambda_challenges_and_advanced_topics.mdwn
b/miscellaneous_lambda_challenges_and_advanced_topics.mdwn
index
a4ba985
..
173ddbe
100644
(file)
--- a/
miscellaneous_lambda_challenges_and_advanced_topics.mdwn
+++ b/
miscellaneous_lambda_challenges_and_advanced_topics.mdwn
@@
-496,20
+496,20
@@
can use.
Think about how you'd implement them in a more principled way. You could
use any of the version 1 -- version 5 implementation of lists as a model.
Think about how you'd implement them in a more principled way. You could
use any of the version 1 -- version 5 implementation of lists as a model.
- To keep things simple,
I recommend starting with the version 3 pattern. And
-
stick to binary trees
.
+ To keep things simple,
we'll stick to binary trees. A node will either be a
+
*leaf* of the tree, or it will have exactly two children
.
There are two kinds of trees to think about. In one sort of tree, it's only
There are two kinds of trees to think about. In one sort of tree, it's only
- the tree's
*leaves*
that are labeled:
+ the tree's
leaves
that are labeled:
- +
+ .
/ \
/ \
-
+
3
+
.
3
/ \
1 2
Linguists often use trees of this sort. The inner, non-leaf nodes of the
/ \
1 2
Linguists often use trees of this sort. The inner, non-leaf nodes of the
-tree have associated values. But what values they are can be determined from
+tree
do
have associated values. But what values they are can be determined from
the structure of the tree and the values of the node's left and right children.
So the inner node doesn't need its own independent label.
the structure of the tree and the values of the node's left and right children.
So the inner node doesn't need its own independent label.