Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Carel Du Plessis](https://secure.gravatar.com/avatar/f62944321a78ed82ab793ab095990c74?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Carel Du Plessis
Courses Plus Student 16,356 PointsI don't see the 3 times it resizes the List
Can someone point out where the list resizes the third time (in the question below)
Question: How many times will the list need to resize while the following code runs?
List favoriteThings = new List();
favoriteThings.Add("sunshine");
favoriteThings.Add("ice cream");
favoriteThings.Add("babies laughing");
favoriteThings.Add("chocolate chip cookies");
favoriteThings.Add("Star Trek");
favoriteThings.Add("bean bag chairs");
favoriteThings.Add("apples");
favoriteThings.Add("snow");
favoriteThings.Add("mountain streams");
favoriteThings.Add("trees");
Answer: 3 times
2 Answers
![Justin Horner](https://uploads.teamtreehouse.com/production/profile-photos/95683/micro_avatar_04.png)
Justin Horner
Treehouse Guest TeacherHello, Carel
The array is resized in this order:
favoriteThings.Add("sunshine");
The first time we add an item, the list is resized to a capacity of 4.
favoriteThings.Add("Star Trek");
Adding a 5th item causes a resize so that the capacity doubles to 8.
favoriteThings.Add("mountain streams");
The final resize happens because we've now asked the list to add a 9th item when it only has a capacity of 8. The resize results in a capacity of 16.
I hope this helps.
![Scott George](https://uploads.teamtreehouse.com/production/profile-photos/9736452/micro_IMG_3340.jpg)
Scott George
19,060 PointsGOT IT! My first thought was, but where is the original list? After reading your explanation, and looking again it hit me, its not about what was added first, well, that too, but this question is more about the process! Yes, my brain got a kick start! Thanks so much Justin!