English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Set and Map question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-09-20 (08:17)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Re: Set and Map question
On Sun, Sep 19, 2004 at 11:02:44PM -0500, Brian Hurt wrote:
> The code is actually fairly easy.  Take the length of the list.  Subtract 
> one for the root node.  The first (n-1)/2 elements are in the left hand 
> subtree, the last n-1-((n-1)/2) elements are in the right subtree.

Wouldn't you have to iterate over the list when implementing this?
What I mean to say is that this would work if you had a pre-sorted
Array, but not a linked List.  ?


Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
http://www.winwinsales.co.uk/ - CRM improvement consultancy