+1 vote
in Data Structures & Algorithms I by (110k points)
The growth factor of ArrayList in Java is _______

(a) 1

(b) 1.5

(c) 2

(d) 0

Origin of the question is Dynamic Array topic in division Arrays Types of Data Structures & Algorithms I

The question was posed to me during a job interview.

1 Answer

+1 vote
by (408k points)
selected by
Best answer
Right answer is (b) 1.5

Explanation: The growth factor of dynamic arrays (Array List) in Java is 3/2.

The new array capacity is calculated as new_array_size = (old_array_size*3)/2+1.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.