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/mono-priorityq-sig.sml
ViewVC logotype

View of /smlnj-lib/trunk/Util/mono-priorityq-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2144 - (download) (annotate)
Thu Nov 2 16:23:11 2006 UTC (12 years, 8 months ago) by blume
File size: 1006 byte(s)
moved smlnj-lib to toplevel
(* mono-priorityq-sig.sml
 *
 * COPYRIGHT (c) 2002 Bell Labs, Lucent Technologies
 *
 * This signature describes the interface to monomorphic functional
 * priority queues.
 *)


signature MONO_PRIORITYQ =
  sig

    type item
    type queue

    val empty : queue

    val singleton : item -> queue
	(* create a queue from a single item *)

    val fromList : item list -> queue
	(* build a queue from a list of items *)

    val insert : (item * queue) -> queue
	(* insert an item *)

    val remove : queue -> (item * queue)
	(* remove the highest priority item from the queue; raise List.Empty
	 * if the queue is empty.
 	 *)

    val next : queue -> (item * queue) option
	(* remove the highest priority item from the queue; return NONE
	 * if the queue is empty.
	 *)

    val merge : (queue * queue) -> queue
	(* Merge two queues. *)

    val numItems : queue -> int
	(* return the number of items in the queue *)

    val isEmpty : queue -> bool
	(* return true, if the queue is empty *)

  end;


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