On Thu, Jun 30, 2011 at 12:56 PM, Andrew <[email protected]> wrote:
> Török Edwin wrote: > >> On 06/30/2011 02:30 PM, Andrew wrote: >> >>> Hi there, >>> >>> Does the standard library provide priority queues in OCaml? I'll be >>> taking exams where I can use OCaml in a few days, but I couldn't find much >>> documentation on priority queues online. >>> >>> >> No, but the manual has an example of implementing priority queues: >> http://caml.inria.fr/pub/docs/**manual-ocaml/manual004.html<http://caml.inria.fr/pub/docs/manual-ocaml/manual004.html> >> > > Ouch. > > > How would you implement Dijkstra's algorithm, otherwise? >>> >> >> C doesn't have priority queues either (ok C++ does), >> but you can implement them yourself. >> >> > Yes it does: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.Make.html Please see min_elt function. Cheers; Wojciech -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
