unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to access a large datastructure efficiently?
@ 2010-03-04  1:50 Christian Wittern
  2010-03-04  6:59 ` Thierry Volpiatto
  0 siblings, 1 reply; 14+ messages in thread
From: Christian Wittern @ 2010-03-04  1:50 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

Here is the problem I am trying to solve:

I have a large list of items which I want to access.  The items are in 
sequential order, but many are missing in between, like:

(1 8 17 23 25 34 45 47 50)  [in reality, there is a value associated 
with this, but I took it out for simplicity]

Now when I am trying to access with a key that is not in the list, I 
want to have the one with the closest smaller key returned, so for 6 
and 7 this would be 1, but for 8 and 9 this would be 8.

Since the list will have thousands of elements, I do not want to simply 
loop through it but am looking for better ways to do this in Emacs lisp.  
Any ideas how to achieve this?

Christian





^ permalink raw reply	[flat|nested] 14+ messages in thread
[parent not found: <mailman.2247.1267667449.14305.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2010-03-05  0:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-04  1:50 how to access a large datastructure efficiently? Christian Wittern
2010-03-04  6:59 ` Thierry Volpiatto
2010-03-04  7:25   ` Thierry Volpiatto
2010-03-04  8:13     ` Andreas Röhler
2010-03-04 11:00       ` Thierry Volpiatto
2010-03-04 15:49         ` Andreas Röhler
2010-03-04 16:09           ` Thierry Volpiatto
2010-03-04  8:15     ` Christian Wittern
2010-03-04 10:24       ` Thierry Volpiatto
2010-03-04 15:01       ` Thien-Thi Nguyen
2010-03-04 16:49       ` Andreas Politz
     [not found] <mailman.2247.1267667449.14305.help-gnu-emacs@gnu.org>
2010-03-04 10:36 ` Alan Mackenzie
2010-03-04 20:22 ` Pascal J. Bourguignon
2010-03-05  0:29 ` Stefan Monnier

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).