Skip Lists Complete the Editor orTrees es p partn tner e - - PowerPoint PPT Presentation

skip lists complete the editor ortrees es p partn tner e
SMART_READER_LITE
LIVE PREVIEW

Skip Lists Complete the Editor orTrees es p partn tner e - - PowerPoint PPT Presentation

Skip Lists Complete the Editor orTrees es p partn tner e evaluati ation on by Wednesday night An alternative to balanced trees Sorted data. Random. Expected times are O(log n). 1-2 Indexed lists. One-level index.


slide-1
SLIDE 1

Skip Lists

slide-2
SLIDE 2

 Complete the Editor

  • rTrees

es p partn tner e evaluati ation

  • n by

Wednesday night

slide-3
SLIDE 3

An alternative to balanced trees Sorted data. Random. Expected times are O(log n).

slide-4
SLIDE 4

 Indexed lists.

  • One-level index.
  • 2nd-level index.
  • 3rd-level index
  • log-n-level index.

 Problem: insertion and deletion.  Solution: Randomized node height: Skip lists.

  • Pugh, 1990 CACM.

 http://iamwww.unibe.ch/~wenger/DA/SkipList/

1-2

Notice that skip lists do not share with binary trees the problem that threads are designed to solve. Remember the problem with keeping trees completely balanced”?

slide-5
SLIDE 5

 Uses a bit more space, makes the code

simpler.

 Michael Goodrich and Roberto Tamassia.

slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11

 No guarantees that we won't get O(N)

behavior.

  • The interaction of the random number generator

and the order in which things are inserted/deleted could lead to a long chain of nodes with the same height.

  • But this is very unlikely.
  • Expec

ected ed time for search, insert, and remove are O(log n).

3