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 UAA22644; Sat, 31 Jul 2004 20:46:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA23387 for ; Sat, 31 Jul 2004 20:46:04 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6VIk0EV009686 for ; Sat, 31 Jul 2004 20:46:02 +0200 Received: from [192.168.1.200] (ppp205-61.lns1.syd3.internode.on.net [203.122.205.61]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i6VIjw4Y032263; Sun, 1 Aug 2004 04:15:59 +0930 (CST) Subject: Re: [Caml-list] Functional arrays From: skaller Reply-To: skaller@users.sourceforge.net To: Jon Harrop Cc: caml-list In-Reply-To: <200407311823.40820.jon@jdh30.plus.com> References: <410B5EBD.6060800@cgorski.org> <200407311444.56864.jon@jdh30.plus.com> <1091291731.11540.368.camel@pelican.wigram> <200407311823.40820.jon@jdh30.plus.com> Content-Type: text/plain Message-Id: <1091299557.11540.405.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 01 Aug 2004 04:45:58 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 410BE8E8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 sourceforge:01 2004:99 2004:99 44,:01 ugg:99 amortize:01 9660:01 glebe:01 arrays:01 arrays:01 nsw:01 snail:02 tree:02 tree:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 2004-08-01 at 03:23, Jon Harrop wrote: > On Saturday 31 July 2004 17:35, skaller wrote: > > On Sat, 2004-07-31 at 23:44, Jon Harrop wrote: > > > Incidentally, does anyone have a functional array implementation (which > > > doesn't suck ;-)? > > > > Map? > > Well, by "array" I mean a container with O(1) random access where "n" is the > number of elements already in the container. ;-) > Anyway, I'm considering implementing arrays which look functional but which > use built-in arrays and keep track of "derived" arrays (e.g. subarrays) Ugg :) How about a tree of buckets? This limits copying on modification to one bucket. When it gets big, you increase the bucket size so the tree part doesn't grow too much, so you could amortize the performance between O(1) and O(log n). -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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