Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 535 Bytes

File metadata and controls

9 lines (7 loc) · 535 Bytes

Example of when IntArrayList would be more efficient and when IntVector would be more efficient.

IntArrayList

  • It is more efficient if the number of elements added grows slowly over time, because it doesn't expand as large.
  • For example, in applications where the initial list size is small, like a shopping cart in an online store.

IntVector

  • It is more efficient when the list is expected to grow significantly.
  • For example, with large amounts of data that will continually grow, like storing large temporary datasets.