Skip Lists Flashcards

1
Q

what is a skip list

A

a probabilistic data structure arranged horizontally into levels and vertically into towers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does each node contain

A

key value pair and pointers to other nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

give the ADT of a skip list

A

after(p) - on same level
before(p) - on same level
above(p) - on same tower
below(p) - on same tower

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what do nodes above/below share

A

the same key value pair

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how are towers usually stored

A

using a separated data structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

how do you search

A

zig zag down and right.

move sideways when the next key is bigger than k, down otherwise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how do you insert

A

create a new node after search(k)

use coin flip to determine how many levels to go up.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly