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
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.
Perhaps I should have chosen C++ then. There's very little time in a competitive exam to implement fudamental data
structures by yourself.
--
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