This is lesson 8 of 11 in this module Course 73% complete

Pre-sizing Lists

Premium Content

Sign in with your account or join us to access this lesson.

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.