My commits are bouncing from the impl list ...

Jonathan.
--- Begin Message ---
You are not allowed to post to this mailing list, and your message has
been automatically rejected.  If you think that your messages are
being rejected in error, contact the mailing list owner at
[EMAIL PROTECTED]

--- Begin Message ---
Revision: 1141
          http://svn.sourceforge.net/felix/?rev=1141&view=rev
Author:   jonok
Date:     2006-10-30 00:17:06 -0800 (Mon, 30 Oct 2006)

Log Message:
-----------
Add find routine to AVL Tree

Modified Paths:
--------------
    felix/trunk/lpsrc/flx_stdlib.pak

Modified: felix/trunk/lpsrc/flx_stdlib.pak
===================================================================
--- felix/trunk/lpsrc/flx_stdlib.pak    2006-10-29 11:44:24 UTC (rev 1140)
+++ felix/trunk/lpsrc/flx_stdlib.pak    2006-10-30 08:17:06 UTC (rev 1141)
@@ -2230,6 +2230,22 @@
 
   //=================================
 
+  fun find[T] (tree : avl[T], y : T, cmp : T*T->int) : opt[T] =>
+      match tree with
+        | Nil => None[T]
+        | Tree(?H, ?x, ?left, ?right) =>
+          if cmp(x, y) > 0 then
+            find(left, y, cmp)
+          elif cmp(x, y) < 0 then
+            find(right, y, cmp)
+          else
+            Some x
+          endif
+      endmatch
+    ;
+
+  //=================================
+
   fun last[T] : avl[T]->T =
     | Tree(_, ?x, _, Nil[T]) => x
     | Tree(_, _, _, ?right) => last(right)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


--- End Message ---

--- End Message ---
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to