[funds-cvs] r27 - trunk/funds/tests/trees

abaine at common-lisp.net abaine at common-lisp.net
Wed Jun 20 16:15:01 UTC 2007


Author: abaine
Date: Wed Jun 20 12:15:00 2007
New Revision: 27

Modified:
   trunk/funds/tests/trees/avl-tree-test.lisp
Log:
Changed a couple of comments.

Modified: trunk/funds/tests/trees/avl-tree-test.lisp
==============================================================================
--- trunk/funds/tests/trees/avl-tree-test.lisp	(original)
+++ trunk/funds/tests/trees/avl-tree-test.lisp	Wed Jun 20 12:15:00 2007
@@ -29,14 +29,14 @@
     2.  the height of the right sub-tree is correct;
     3.  the height of the given tree is 1 more than the greater
         of the heights of the left and right sub-trees."
-  (if (avl-empty-p tree)
-      (zerop (avl-height tree))
-      (and (height-correct-p (avl-left tree))
-	   (height-correct-p (avl-right tree))
+  (or (and (avl-empty-p tree)
+	   (zerop (avl-height tree)))                ; (a)
+      (and (height-correct-p (avl-left tree))        ; (1)
+	   (height-correct-p (avl-right tree))       ; (2)
 	   (let* ((a (avl-height (avl-left tree)))
 		  (b (avl-height (avl-right tree)))
 		  (c (if (> a b) a b))) 
-	     (eql (1+ c) (avl-height tree))))))
+	     (eql (1+ c) (avl-height tree))))))      ; (3)
 
 (defun balanced-p (tree)
   "Whether the given AVL Tree is properly balanced.  To be balanced,



More information about the Funds-cvs mailing list