What is the primary disadvantage of using a dynamic array? a) slow insertion time b) increased space complexity c) reduced time complexity d) lack of random access
Understand the Problem
The question is asking about the disadvantages of dynamic arrays, specifically which option represents the primary disadvantage among the provided choices. We will evaluate each option to identify the correct one.
Answer
Slow insertion time.
The primary disadvantage of using a dynamic array is slow insertion time.
Answer for screen readers
The primary disadvantage of using a dynamic array is slow insertion time.
More Information
Dynamic arrays typically experience slow insertion times because when the array reaches its capacity, it must allocate a new larger array and copy all elements over, which is time-consuming.
Tips
A common misconception is that dynamic arrays lack random access; however, similar to static arrays, they do support constant time random access.
Sources
- Dynamic arrays disadvantage - Quizgecko - quizgecko.com