From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p5UCTRgO006017 for ; Thu, 30 Jun 2011 14:29:27 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQBAP9qDE5V2gB5hWdsb2JhbABSp2gBAQEKCwsFFiWIer8PDoYjBJdCix0 X-IronPort-AV: E=Sophos;i="4.65,449,1304287200"; d="scan'208";a="102267580" Received: from emailfrontal2.citycable.ch ([85.218.0.121]) by mail4-smtp-sop.national.inria.fr with SMTP; 30 Jun 2011 14:29:21 +0200 X-Alinto-smtpauth-localdomain: Yes Received: from seldon (unknown [85.218.93.111]) (Authenticated sender: guillaume.yziquel@citycable.ch) by emailfrontal2.citycable.ch (Postfix) with ESMTPA id 6548C20C192; Thu, 30 Jun 2011 14:29:13 +0200 (CEST) Received: from yziquel by seldon with local (Exim 4.72) (envelope-from ) id 1QcGLn-0000Or-MS; Thu, 30 Jun 2011 14:28:07 +0200 Date: Thu, 30 Jun 2011 14:28:07 +0200 From: Guillaume Yziquel To: Andrew Cc: caml-list@inria.fr Message-ID: <20110630122807.GR7159@localhost> References: <4E0C5E67.9010606@gmail.com> <4E0C60A1.7030103@gmail.com> <4E0C6463.2070708@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <4E0C6463.2070708@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p5UCTRgO006017 Subject: Re: [Caml-list] Priority queues Le Thursday 30 Jun 2011 ā 13:56:19 (+0200), Andrew a écrit : > 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. There's an implementation of them in Jane Street's library, and Markus Mottl also has a repositorial where he implemented some structures from Okasaki's little book. http://hg.ocaml.info/release/pure-fun/file/330eff97ead2 But I'm not sure whether that fits the scope of a "competitive exam". -- Guillaume Yziquel