Dynamic Arrays and Amortized Analysis Flashcards

1
Q

Dynamic array in c++, c#

A

uses vector, list

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

difference between array and dynamic array is

A

resizable

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

the operation time of appending a new element to a dynamic array is

A

often o(1), but o(n) only if resize need

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

resizing happens by

A

factor of two. (some space can be wasted)

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

Amortized Analysis : the definition of aggregate method is

A

the cost of n operations divided by n.

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

Amortized Analysis : the definition of Banker’s method is

A

Charge extra for each cheap operation and save the extra charge as tokens to pay for expensive operations.

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