caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Toby Kelsey <toby.kelsey@gmail.com>
To: caml-list@inria.fr
Cc: syshen@nudt.edu.cn
Subject: Re: [Caml-list] [CAML]:: efficient data structure for storing and searching int list list
Date: Fri, 12 Apr 2013 23:15:25 +0100	[thread overview]
Message-ID: <5168877D.1090103@gmail.com> (raw)
In-Reply-To: <58e60ce1.4599.13dfeacfdb3.Coremail.syshen@nudt.edu.cn>

On 12/04/13 15:36, 沈胜宇 wrote:
> Dear all:
> I have an int list list, whose name is LL
> and I need to frequently decide whether a particular int list, whose name is L, is a sublist of an element of LL.
> 
> Is there any efficent data structure to do this?

A data structure useful for finding substrings quickly is the "suffix tree",
this can be built in O(n) - for small alphabets - or O(n log n) time and
substring searches take O(length substring) time. The suffix tree takes more
space than the original string though. An int list can take the role of the
string here.

Toby

  parent reply	other threads:[~2013-04-12 22:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 14:36 沈胜宇
2013-04-12 15:01 ` simon cruanes
2013-04-12 15:48 ` Jean-Francois Monin
2013-04-13  6:58   ` 沈胜宇
2013-04-13  7:56     ` Gabriel Scherer
2013-04-12 22:15 ` Toby Kelsey [this message]
2013-04-13  6:57   ` 沈胜宇
2013-04-23  9:05     ` Goswin von Brederlow

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=5168877D.1090103@gmail.com \
    --to=toby.kelsey@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=syshen@nudt.edu.cn \
    /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).