unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Politz <politza@hochschule-trier.de>
To: Joakim Jalap <joakim.jalap@fastmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Overlay tree. Stuck again
Date: Fri, 03 Feb 2017 09:27:36 +0100	[thread overview]
Message-ID: <87r33fsmpz.fsf@hochschule-trier.de> (raw)
In-Reply-To: <87ziivqilc.fsf@fastmail.com> (Joakim Jalap's message of "Fri, 13 Jan 2017 12:56:15 +0100")

Joakim Jalap <joakim.jalap@fastmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>> [...] try removing them from the tree, and then re-adding them [...]
>
> Yes, that is the "big hammer" approach :) I hae thought about it, but I
> think the problem is that it will be too expensive. [...]

Joakim, I think that trying to somehow manually fix the disorder is at
least as expensive as a deletion and reinsertion.  Because if it weren't
you would have essentially discovered a better algorithm for balancing
trees then the one you've got.

The trick is probably to gather the dirty nodes in post-order and delete
them all at once. This way you're only removing a node, if its
corresponding sub-tree is in order.  After that you're free to reinsert
them again.

-ap



  parent reply	other threads:[~2017-02-03  8:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 21:10 Overlay tree. Stuck again Joakim Jalap
2017-01-13  8:12 ` Eli Zaretskii
2017-01-13 11:56   ` Joakim Jalap
2017-01-13 13:22     ` Fabrice Popineau
2017-01-13 14:20       ` Joakim Jalap
2017-01-13 13:54     ` Eli Zaretskii
2017-01-13 14:26       ` Joakim Jalap
2017-02-03  8:27     ` Andreas Politz [this message]
2017-02-03  8:28     ` Andreas Politz
2017-02-03 12:35       ` Joakim Jalap
2017-02-03  8:28     ` Andreas Politz

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=87r33fsmpz.fsf@hochschule-trier.de \
    --to=politza@hochschule-trier.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=joakim.jalap@fastmail.com \
    /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).