Skip to main content
This is lesson 8 of 14 in this module 8/14

Pre-sizing Lists

The lesson explains the internal doubling-expansion algorithm that generic List uses when capacity is exhausted, and how pre-allocating capacity with the constructor's int parameter eliminates those copy operations. We discuss when pre-sizing is worth the effort and introduce arrays as the fastest alternative when the element count is known in advance.

Video lesson

Want to watch this lesson?

This lesson is part of the study plan. Get instant access to all lectures, labs and practice exams.

Get the Study Plan