Skiplists Flashcards

1
Q

What interfaces can Skiplists implement?

A

SSet

List

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

What is the runtime of the add(x) method for a SkiplistSSet?

A

O(log n) expected time

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

What is the runtime of the remove(x) method for a SkiplistSSet?

A

O(log n) expected time

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

What is the runtime of the find(x) method for a SkiplistSSet?

A

O(log n) expected time

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

How much extra space does a SkiplistSSet require to store n elements?

A

O(n) extra space in expectation.

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

What is the search path for element x in a Skiplist?

A

It is the path constructed from the top left sentinel node to the node x in L0 that is constructed by moving right while you don’t overshoot x, and moving down otherwise, until you get to (the predecessor of) x in L0.

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

What is the expected length of a search path in a skiplist?

A

O(log n) in expectation

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

What is the backing storage of a skiplist?

A

A sentinel node

which itself is an array of Node pointers and a spot for data.

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

What is the runtime of the get(i) method for a SkiplistList?

A

O(log n) in expectation

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

What is the runtime of the set(i,x) method for a SkiplistList?

A

O(log n) in expectation

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

What is the runtime of the add(i,x) method for a SkiplistList?

A

O(log n) in expectation

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

What is the runtime of the remove(i) method for a SkiplistList?

A

O(log n) in expectation

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