Dynamic Arrays and Amortized Analysis Flashcards
1
Q
Dynamic array in c++, c#
A
uses vector, list
2
Q
difference between array and dynamic array is
A
resizable
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
4
Q
resizing happens by
A
factor of two. (some space can be wasted)
5
Q
Amortized Analysis : the definition of aggregate method is
A
the cost of n operations divided by n.
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.