caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gerd Stolpmann <info@gerd-stolpmann.de>
To: "Lars Nilsson" <chamaeleon@adelphia.net>, <caml-list@inria.fr>
Subject: Re: [Caml-list] time complexity on basic data types
Date: Fri, 24 Aug 2001 01:50:49 +0200	[thread overview]
Message-ID: <01082401522806.02716@ice> (raw)
In-Reply-To: <002d01c12c23$2179ea40$0200a8c0@buf.adelphia.net>

On Fri, 24 Aug 2001, Lars Nilsson wrote:
>At the risk of making a fool of myself in public, is there such a thing as
>insertion in a list at all in Ocaml? From what I have seen there is only
>concatenation of a single element and a list (::), and operations would have
>to be defined with this by means recursion/iteration. If this is the case, I
>assume insertion at some point in a list would have O(n) complexity in the
>general case? If not, what am I missing (@ being something other than I
>think?)

You are right, only :: is possible. So insertion at arbitrary positions is O(n)
time.

Gerd
-- 
----------------------------------------------------------------------------
Gerd Stolpmann      Telefon: +49 6151 997705 (privat)
Viktoriastr. 45             
64293 Darmstadt     EMail:   gerd@gerd-stolpmann.de
Germany                     
----------------------------------------------------------------------------
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-08-24  0:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-23 17:27 Krishnaswami, Neel
2001-08-23 17:35 ` Xavier Leroy
2001-08-23 22:29 ` Lars Nilsson
2001-08-23 23:50   ` Gerd Stolpmann [this message]
2001-08-24 12:27   ` Jean-Christophe Filliatre
  -- strict thread matches above, loose matches on Subject: below --
2001-08-23 16:16 Collin Monahan

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=01082401522806.02716@ice \
    --to=info@gerd-stolpmann.de \
    --cc=caml-list@inria.fr \
    --cc=chamaeleon@adelphia.net \
    --cc=gerd@gerd-stolpmann.de \
    /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).