Question: A Vector class is implemented with a default initial capacity of 5 . Each time the Vector runs out of space it grows the storage

A Vector class is implemented with a default initial capacity of 5. Each time the Vector runs out of space it grows the storage space by doubling capacity. If you instantiate one of these containers and add 12 elements, how many times will the internal storage need to be resized, and what will the final capacity be?
A.0 resizes, 12 capacity
B.2 resizes, 15 capacity
C.1 resizes, 10 capacity
D.2 resizes, 20 capacity
E.3 resizes, 15 capacity
 A Vector class is implemented with a default initial capacity of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!