unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andy Sonnenburg <andy22286@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Binary Search Tree and Treap Functions bst-assq and treap-put
Date: Sun, 4 Dec 2016 07:14:26 -0500	[thread overview]
Message-ID: <CAHtDYY9SzUt9_DCXuLUJY7xe2p0yJ9cgx7taKjMyZLErp2=2Vg@mail.gmail.com> (raw)
In-Reply-To: <CAHtDYY9__BVOAs+vX=Tj8Bf31X6-Duv3f9MS8vcGwsnO2x74+w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

That's too bad (I mean, its good for performance, but unfortunate one of
the use cases doesn't exist).  However, the treap functions may still be of
general use.  Let me know if there is any interest.  They are documented
and tested.  They fill a gap between alists (persistent, linear lookup) and
hash tables (ephemeral, constant lookup) by being persistent while
providing average case logarithmic lookup.

On Dec 3, 2016 11:34 PM, "Stefan Monnier" <monnier@iro.umontreal.ca> wrote:

> now.  I intend to use these functions to make lexically-scoped variable
> lookup average case O(log(n)) instead of the current O(n).

AFAIK it's O(1) currently (for byte-compiled code only, but performance
of non-byte-compiled code should be of no importance).


        Stefan

[-- Attachment #2: Type: text/html, Size: 1186 bytes --]

  parent reply	other threads:[~2016-12-04 12:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-04  1:42 Binary Search Tree and Treap Functions bst-assq and treap-put Andy Sonnenburg
2016-12-04  4:33 ` Stefan Monnier
     [not found]   ` <CAHtDYY-xis2R4Nbvq_8Ht0nKsm6KjGqW=NSC7O3+5FvNF9w+Dg@mail.gmail.com>
     [not found]     ` <CAHtDYY9__BVOAs+vX=Tj8Bf31X6-Duv3f9MS8vcGwsnO2x74+w@mail.gmail.com>
2016-12-04 12:14       ` Andy Sonnenburg [this message]
2016-12-04 17:04         ` Stefan Monnier
2016-12-04 17:13           ` Andy Sonnenburg
2016-12-04 17:39             ` Andy Sonnenburg
2016-12-04 17:41             ` Eli Zaretskii
2016-12-12  6:15           ` John Wiegley
2016-12-12 12:56             ` Stefan Monnier
2016-12-12 16:46               ` John Wiegley
2016-12-12 16:58                 ` Stefan Monnier
2016-12-12 17:06                   ` John Wiegley
2016-12-12 17:29                     ` Stefan Monnier
2017-10-22 16:35   ` Noam Postavsky
2017-10-22 16:44     ` Andreas Schwab
2017-10-22 16:44     ` Stefan Monnier
2017-10-22 17:12       ` Noam Postavsky
2017-10-23  0:37         ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAHtDYY9SzUt9_DCXuLUJY7xe2p0yJ9cgx7taKjMyZLErp2=2Vg@mail.gmail.com' \
    --to=andy22286@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).