{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "551a4ae6",
   "metadata": {},
   "source": [
    "# Algorithms\n",
    "\n",
    "This chapter introduces algorithm foundations using a simple input-process-output model.\n",
    "\n",
    "**Learning Goals**\n",
    "- Explain an algorithm using input, process, and output\n",
    "- Identify sequence, decision, and repetition in algorithm steps\n",
    "- Connect efficiency to Big O growth trends\n",
    "- Apply a small design checklist before coding\n",
    "- Prepare for search and sorting notebooks"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b371478e",
   "metadata": {},
   "source": [
    "The concept of computer algorithm may be represented as the flowchart below. \n",
    "\n",
    "```text\n",
    "         INPUT\n",
    "           │\n",
    "           ▼\n",
    "    ┌──────────────┐\n",
    "    │   STEP  1    │\n",
    "    └──────┬───────┘\n",
    "           │\n",
    "           ▼\n",
    "    ┌──────────────┐\n",
    "    │   STEP  2    │\n",
    "    └──────┬───────┘\n",
    "           │\n",
    "           ▼\n",
    "    ┌──────────────┐        ┌─────────────┐\n",
    "    │   STEP  3    │──YES──▶│  DO  THIS   │\n",
    "    │  condition?  │        └─────────────┘\n",
    "    └──────┬───────┘\n",
    "           │ NO\n",
    "           ▼\n",
    "    ┌──────────────┐\n",
    "    │   STEP  4    │◀─────────────┐\n",
    "    └──────┬───────┘              │\n",
    "           │                      │\n",
    "           ▼                      │\n",
    "    ┌──────────────┐              │\n",
    "    │   loop?      │──────────────┘\n",
    "    └──────┬───────┘\n",
    "           │ done\n",
    "           ▼\n",
    "         OUTPUT\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98075734",
   "metadata": {},
   "source": [
    "<h2>Chapter flow</h2>\n",
    "\n",
    "```{tableofcontents}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "144bff8a",
   "metadata": {},
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv (3.13.7)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
