Skip to contentSkip to conversation

Skip lists and splay trees

DISCUSSION Colin Plumb 2 participants 2 messages Aug 25, 1998

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · Jamie Lokier

I would definitely recommend a skip list or splay tree. Both are very fast. Both are very short code. (_Much_ shorter and simpler than the AVL code was).

The skip list has the advantage that it's fairly simple to code and nothing is written (cache advantage).

The splay tree has the advantage that it automatically caches the recently used entries. So much so that there's no need for a one entry cache in front of it.

Skip lists have the notable disadvantage that nodes are variable-sized (due to the random number of pointers in them), which complicates memory management, a great kernel preoccupation.

Splay trees are amenable to a number of heuristics like self-adjusting lists, like move-to-front or move-forward-one. They might be worth playing with a bit.

Signature · 6 lines
	-Colin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html
#1 lore raw

Those of you wondering what splay trees are might want to look at a on-line demo, at:

http://gs213.sp.cs.cmu.edu/prog/splay

For balance, there are papers on skiplists at:

ftp://ftp.cs.umd.edu/pub/skipLists/

Rich.

Signature · 9 lines
Richard Jones [email protected] Tel: +44 171 598 7557 Fax: 460 4461
Orchestream Ltd.  125 Old Brompton Rd. London SW7 3RP PGP: www.four11.com
"boredom ... one of the most overrated emotions ... the sky is made
of bubbles ..."   Original message content Copyright © 1998

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html