{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "836bf41b",
   "metadata": {},
   "source": "```{index} collections collections\n```\n\n(collections)=\n\n# Collections\n\nArrays have fixed sizes. When the amount of data is unknown or changes while the program runs, C# provides dynamic collection types. This chapter introduces `List<T>` and `Dictionary<TKey, TValue>`, two of the most widely used collections.\n\n- **List**: A `List<T>` stores an ordered sequence that can grow or shrink.\n- **Dictionary**: A `Dictionary<TKey, TValue>` maps keys to values for fast lookup.\n- **Generics**: Generic type parameters keep collections type-safe while making them reusable.\n- **Access pattern**: Choosing a collection depends on whether you need order, lookup by key, insertion, removal, or traversal.\n\nCollections let programs handle real data sizes and changing workloads without manually managing every storage detail.\n"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": "<h2>Video</h2>\n\n```{eval-rst}\n.. youtube:: vQzREQUhGSA\n   :width: 560\n   :height: 315\n```\n\n> *[C# Lists 📃](https://youtube.com/watch?v=vQzREQUhGSA)* by Bro Code.\n>\n> This video remains hosted on YouTube and is the property of its original creator or rightsholder; it is embedded here via YouTube's official player for educational reference only.\n",
   "id": "intro-video"
  },
  {
   "cell_type": "markdown",
   "id": "learning-objectives",
   "metadata": {},
   "source": "<h2>Learning Objectives</h2>\n\nBy the end of this chapter, you will be able to:\n1. Create and populate `List<T>` values using common list operations\n2. Use `Dictionary<TKey, TValue>` to store and retrieve key-value pairs\n3. Iterate over collections with `foreach` loops\n4. Explain how generics make collections type-safe\n5. Choose between arrays, lists, and dictionaries for common data tasks\n"
  },
  {
   "cell_type": "markdown",
   "id": "chapter-flow",
   "metadata": {},
   "source": "<h2>Chapter Flow</h2>\n\n```{tableofcontents}\n```\n"
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "main_language": "python",
   "notebook_metadata_filter": "-all"
  },
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
