Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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.
Merjis Ltd. - improving website return on investment - CRM improvement consultancy