From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA10142; Mon, 20 Sep 2004 10:17:14 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA10060 for ; Mon, 20 Sep 2004 10:17:13 +0200 (MET DST) Received: from annexia.force9.co.uk (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i8K8HDHm020303 for ; Mon, 20 Sep 2004 10:17:13 +0200 Received: from rich by annexia.force9.co.uk with local (Exim 3.36 #1 (Debian)) id 1C9JMC-0000jr-00; Mon, 20 Sep 2004 09:17:08 +0100 Date: Mon, 20 Sep 2004 09:17:08 +0100 To: Brian Hurt Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] Re: Set and Map question Message-ID: <20040920081708.GA2792@annexia.org> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 414E9209.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 crm:99 consultancy:99 ltd:98 linked:01 sep:01 node:02 wrote:03 array:04 investment:94 mean:05 brian:06 implementing:07 root:07 X-Attachments: type="application/pgp-signature" name="signature.asc" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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= =20 > one for the root node. The first (n-1)/2 elements are in the left hand= =20 > 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. ? Rich. --=20 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 --9amGYk9869ThD9tj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQFBTpIE4le1M6q9pzoRAguAAJ4iRQyDjLE+ahZ+sYsj0YEPQ9IAJwCgiBQR SUnXlr9U6+AVTE8OO1BMpso= =2fK3 -----END PGP SIGNATURE----- --9amGYk9869ThD9tj-- ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners