From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p5UCDX84004733 for ; Thu, 30 Jun 2011 14:13:33 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBAMBnDE7RVdo2mGdsb2JhbAAxCxaYZ4ZaAYgKCBQBAQEBAQgJDQcUJYh4okiOawGNcgWGMZIziUWCVzyDVw X-IronPort-AV: E=Sophos;i="4.65,449,1304287200"; d="scan'208";a="112247306" Received: from mail-yi0-f54.google.com ([209.85.218.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 30 Jun 2011 14:13:27 +0200 Received: by yic13 with SMTP id 13so1324081yic.27 for ; Thu, 30 Jun 2011 05:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YXk9zhmfLKMrJoC66/lw5bBgzKDn2iAZhOWQ8xUliIg=; b=AgAW5TJLp/rYyqhVLOQURM67TRZw1+j1qO1JoULnTS8aHPo4w5TjwcF1CU/hLPR/R7 WBFoBNluhWcbMCuIRTdDBUzv+vFpTc+zxWiv5GlOGXE3xkVfcwzZJxJtSiL/9KJ9Uxfb WtUgHfvejDxinxKM9w24J7JCUdXheb7s+/wGw= MIME-Version: 1.0 Received: by 10.150.175.20 with SMTP id x20mr441786ybe.92.1309436006387; Thu, 30 Jun 2011 05:13:26 -0700 (PDT) Received: by 10.151.43.6 with HTTP; Thu, 30 Jun 2011 05:13:26 -0700 (PDT) In-Reply-To: <4E0C6463.2070708@gmail.com> References: <4E0C5E67.9010606@gmail.com> <4E0C60A1.7030103@gmail.com> <4E0C6463.2070708@gmail.com> Date: Thu, 30 Jun 2011 13:13:26 +0100 Message-ID: From: Wojciech Meyer To: Andrew Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=000e0cd7549204510a04a6ecd47a X-Validation-by: wojciech.meyer@googlemail.com Subject: Re: [Caml-list] Priority queues --000e0cd7549204510a04a6ecd47a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Jun 30, 2011 at 12:56 PM, Andrew wrote: > T=F6r=F6k 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 m= uch >>> 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. >> >> > Yes it does: http://caml.inria.fr/pub/docs/manual-ocaml/libref/Set.Make.html Please see min_elt function. Cheers; Wojciech --000e0cd7549204510a04a6ecd47a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Jun 30, 2011 at 12:56 PM, Andrew= <newsgroups.fr@<= a href=3D"http://gmail.com">gmail.com> wrote:
T=F6r=F6k 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 tak= ing 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.ht= ml

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.



Cheers;
Wojciech

--000e0cd7549204510a04a6ecd47a--