Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /smlnj-lib/trunk/Util/splaytree-sig.sml
ViewVC logotype

View of /smlnj-lib/trunk/Util/splaytree-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2144 - (download) (annotate)
Thu Nov 2 16:23:11 2006 UTC (12 years, 11 months ago) by blume
File size: 804 byte(s)
moved smlnj-lib to toplevel
(* splaytree-sig.sml
 *
 * COPYRIGHT (c) 1993 by AT&T Bell Laboratories.  See COPYRIGHT file for details.
 *
 * Signature for a splay tree data structure.
 *
 *)

signature SPLAY_TREE = 
  sig
    datatype 'a splay = 
      SplayObj of {
        value : 'a,
        right : 'a splay,
        left : 'a splay
      }
    | SplayNil


    val splay : (('a -> order) * 'a splay) -> (order * 'a splay)
      (* (r,tree') = splay (cmp,tree) 
       * where tree' is tree adjusted using the comparison function cmp
       * and, if tree' = SplayObj{value,...}, r = cmp value.
       * tree' = SplayNil iff tree = SplayNil, in which case r is undefined.
       *)

    val join : 'a splay * 'a splay -> 'a splay
      (* join(t,t') returns a new splay tree formed of t and t'
       *)

  end (* SPLAY_TREE *)


root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0