SCM Repository
View of /sml/trunk/src/smlnj-lib/Util/mono-priorityq-sig.sml
Parent Directory
|
Revision Log
Revision 1061 -
(download)
(annotate)
Tue Feb 12 22:21:13 2002 UTC (18 years, 11 months ago) by jhr
File size: 930 byte(s)
Tue Feb 12 22:21:13 2002 UTC (18 years, 11 months ago) by jhr
File size: 930 byte(s)
Added priority queue implementation.
(* 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 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 |