{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "836bf41b",
   "metadata": {},
   "source": "```{index} collections collections\n```\n\n(collections)=\n\n# Collections\n\n<!-- chapter-intro -->\n\nArrays have fixed sizes. When the amount of data is unknown or changes at runtime, C# provides dynamic collection types. This chapter covers `List<T>` and `Dictionary<TKey, TValue>` — the two most widely used collections.\n"
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "id": "93719bf2",
   "source": "<h2>Why this chapter matters</h2>\n\nReal programs rarely know in advance exactly how many items they will process:\n\n- a list grows or shrinks as items are added or removed\n- a dictionary maps keys to values for fast lookup\n- generics enforce type safety while keeping collections reusable\n- built-in methods handle common tasks: sorting, searching, filtering\n"
  },
  {
   "cell_type": "markdown",
   "id": "66dd248f",
   "metadata": {},
   "source": "<h2>Learning goals</h2>\n\nBy the end of this chapter, you should be able to:\n\n- create and populate `List<T>` with `Add`, `Remove`, and `Contains`\n- use `Dictionary<TKey, TValue>` to store and retrieve key-value pairs\n- iterate over collections with `foreach`\n- choose between `List` and `Dictionary` based on access pattern\n\n<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
}