caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@maxtal.com.au>
To: Lyn A Headley <laheadle@cs.uchicago.edu>
Cc: Pierre Weis <Pierre.Weis@inria.fr>, caml-list@inria.fr
Subject: Re: Data structures in ocaml
Date: Wed, 13 Oct 1999 04:52:37 +1000	[thread overview]
Message-ID: <38038375.4D58AFC3@maxtal.com.au> (raw)
In-Reply-To: <19991011053733.76BC3120@yeenoghu.cs.uchicago.edu>

Lyn A Headley wrote:

> Python "lists" are based on arrays, so I believe the performance is as
> follows (some of these functions don't really exists, but would be
> "faked" using slices or somesuch):

> append_lists([l1, l2, ... ln]) not sure if this exists.  The naive
> implementation using "+" would be quadratic.

That's an interesting observation: thanks for pointing it
out. In fact, expressions like

	x = a + b + c + d

are common manipulating strings in Python. Because I represent this
as a list, _not_ recursively, I can get linear performance,
if there is a way to preallocate the storage. [I can't remember
off hand if the 'Buffer' class allows this]. I can also do it 
for (python) lists, using Varray.

-- 
John Skaller, mailto:skaller@maxtal.com.au
1/10 Toxteth Rd Glebe NSW 2037 Australia
homepage: http://www.maxtal.com.au/~skaller
downloads: http://www.triode.net.au/~skaller




      reply	other threads:[~1999-10-13  6:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-06 18:50 skaller
1999-10-07 12:10 ` Pierre Weis
1999-10-08 18:05   ` skaller
1999-10-09 23:17     ` Markus Mottl
1999-10-09 23:52     ` Pierre Weis
1999-10-10  8:14       ` skaller
1999-10-10 12:56       ` Michel Quercia
1999-10-10 21:16         ` Pierre Weis
1999-10-11  5:37           ` Lyn A Headley
1999-10-12 18:52             ` skaller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38038375.4D58AFC3@maxtal.com.au \
    --to=skaller@maxtal.com.au \
    --cc=Pierre.Weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=laheadle@cs.uchicago.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).