From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, emacs-devel@gnu.org
Subject: Re: master 792ba71: Add a new function 'buffer-line-statistics'
Date: Tue, 12 Jan 2021 14:54:23 -0500 [thread overview]
Message-ID: <jwv35z62b47.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83ft36c6bq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 12 Jan 2021 21:18:17 +0200")
>> https://www.stat.cmu.edu/~ryantibs/papers/median.pdf
> I used this one:
> https://www.cse.wustl.edu/~jain/papers/ftp/psqr.pdf
Thanks!
FWIW, last time I needed a fast approximation of the median was in the
`src/profiler.c` code, and I just used the approach you can see in
`approximate_median` (basically, the approximate median I used is the
median of 3 (recursive) approximate medians).
So, it's O(N) worst case time complexity and O(log N) worst case
(stack) space complexity.
Stefan
prev parent reply other threads:[~2021-01-12 19:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210112174748.18372.29339@vcs0.savannah.gnu.org>
[not found] ` <20210112174750.5928220B2C@vcs0.savannah.gnu.org>
2021-01-12 18:15 ` master 792ba71: Add a new function 'buffer-line-statistics' Stefan Monnier
2021-01-12 18:29 ` Philipp Stephani
2021-01-12 19:06 ` Stefan Monnier
2021-01-12 18:37 ` Eli Zaretskii
2021-01-12 18:43 ` Eli Zaretskii
2021-01-12 18:39 ` Lars Ingebrigtsen
2021-01-12 19:18 ` Eli Zaretskii
2021-01-12 19:54 ` Stefan Monnier [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=jwv35z62b47.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=larsi@gnus.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.