X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=coroutines_and_aborts.mdwn;h=50b6600ff9f7c952ea00d510706cb57165209703;hp=272765a46b0d45393f4f0be6ceae50469ee53e11;hb=12ba49b7826c64a85032e1640db29d4c947347f9;hpb=911d868126d0b91047b362cb909cdfeb503cd16b diff --git a/coroutines_and_aborts.mdwn b/coroutines_and_aborts.mdwn index 272765a4..50b6600f 100644 --- a/coroutines_and_aborts.mdwn +++ b/coroutines_and_aborts.mdwn @@ -21,7 +21,7 @@ Supposing you did work out an implementation of the tree zipper, then one way to / \ / \ 1 2 2 3 -you won't move upwards at the same steps. Keep comparing "the next leafs" until they are different, or you exhaust the leafs of only one of the trees (then again the trees have different fringes), or you exhaust the leafs of both trees at the same time, without having found leafs with different labels. In this last case, the trees have the same fringe. +you won't move upwards at the same steps. Keep comparing "the next leaves" until they are different, or you exhaust the leaves of only one of the trees (then again the trees have different fringes), or you exhaust the leaves of both trees at the same time, without having found leaves with different labels. In this last case, the trees have the same fringe. If your trees are very big---say, millions of leaves---you can imagine how this would be quicker and more memory-efficient than traversing each tree to construct a list of its fringe, and then comparing the two lists so built to see if they're equal. For one thing, the zipper method can abort early if the fringes diverge early, without needing to traverse or build a list containing the rest of each tree's fringe.