Midterm Study From Quizes Flashcards
1
Q
Arrange the following expressions from the slowest to fastest growth rate.
A
2
Q
A
3
Q
A
4
Q
A
5
Q
A
6
Q
A
7
Q
A
8
Q
A
9
Q
A
10
Q
A
11
Q
A
false
12
Q
A
13
Q
A
14
Q
A
O(n). When resizing, a new array must be created, and each existing element in the old array is then individually copied into the new array.
15
Q
When do we need to increase the capacity of the underlying data storage array (i.e. data) in order to make space for the new element.
A
When the array is full, the current size equals the capacity. We must then call resize() to increase the array capacity
16
Q
A
[0, 3, 6, 9, 12, 15]
17
Q
The order in which elements are placed into the Bag ADT is important
A
False, Conceptually, we use the Bag ADT when the insertion order is irrelevant for the problem we’re working on.