From 824d47ccee20db9410d1c222f8e96a4077929a5a Mon Sep 17 00:00:00 2001 From: Jim Pryor Date: Fri, 26 Nov 2010 11:30:10 -0500 Subject: [PATCH] tweak zipper Signed-off-by: Jim Pryor --- zipper.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zipper.mdwn b/zipper.mdwn index 5bdf3451..87752316 100644 --- a/zipper.mdwn +++ b/zipper.mdwn @@ -240,4 +240,7 @@ Supposing you did work out an implementation of the tree zipper, then one way to 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. +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 built a list containing the rest of each tree's fringe. + + -- 2.11.0