X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week4.mdwn;h=bc154aea1195830c5858a716055ec250c4229a3e;hp=fb843462cfda3053bfe8c95651ae56fc72375d85;hb=bb7d661ae9cacbe86e730ab3eea5cf2ff864912e;hpb=d6f2385162de2e0c3c29758d90ef0ec89ae9f776 diff --git a/week4.mdwn b/week4.mdwn index fb843462..bc154aea 100644 --- a/week4.mdwn +++ b/week4.mdwn @@ -27,11 +27,13 @@ of `T`, by the reasoning in the previous answer. A: Right:
let Y = \T. (\x. T (x x)) (\x. T (x x)) in
-Y Y ≡ \T. (\x. T (x x)) (\x. T (x x)) Y
+Y Y
+≡ \T. (\x. T (x x)) (\x. T (x x)) Y
~~> (\x. Y (x x)) (\x. Y (x x))
~~> Y ((\x. Y (x x)) (\x. Y (x x)))
~~> Y (Y ((\x. Y (x x)) (\x. Y (x x))))
-~~> Y (Y (Y (...(Y (Y Y))...)))
+~~> Y (Y (Y (...(Y (Y Y))...)))
+
#Q: Ouch! Stop hurting my brain.#
@@ -248,7 +250,7 @@ So, if we were searching the list that implements some set to see if the number
we can stop. If we haven't found `5` already, we know it's not in the rest of the
list either.
-This is an improvement, but it's still a "linear" search through the list.
+*Comment*: This is an improvement, but it's still a "linear" search through the list.
There are even more efficient methods, which employ "binary" searching. They'd
represent the set in such a way that you could quickly determine whether some
element fell in one half, call it the left half, of the structure that
@@ -258,7 +260,7 @@ determination could be made for whichever half you were directed to. And then
for whichever quarter you were directed to next. And so on. Until you either
found the element or exhausted the structure and could then conclude that the
element in question was not part of the set. These sorts of structures are done
-using **binary trees** (see below).
+using [binary trees](/implementing_trees).
#Aborting a search through a list#