{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "0Y97E2DMB7"
    }
  ],
  "body": "\n## Definition\n\nThe binary trees are defined recursively by these two rules.\nThe empty tree is a binary tree. It has no nodes.\nIf $L$ and $R$ are binary trees, then $\\operatorname{node}(L, R)$ is a binary tree. It has one more node than $L$ and $R$ together, the root, with left subtree $L$ and right subtree $R$.\nEvery binary tree comes from these two rules in a unique way, in finitely many steps.\n\n## Remarks\n\nThe left and right subtrees are ordered. Thus $\\operatorname{node}(\\operatorname{node}(\\varnothing, \\varnothing), \\varnothing)$ and $\\operatorname{node}(\\varnothing, \\operatorname{node}(\\varnothing, \\varnothing))$ are different binary trees with $2$ nodes.\nThe number of binary trees with $n$ nodes is the Catalan number $C_n$. The node [[binary trees are counted by Catalan numbers|0Y97E2DMB7]] states this.\nA nonempty binary tree is a [[rooted tree|0C9J6W2A8A]] in which each vertex has at most two children, each marked left or right.\n\n## Explanations\n\n### L1 human\n\nA binary tree is either empty, or a root with a left part and a right part that are binary trees again.\nBinary trees are used in computer science to store data for fast search.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "defines": "0D7EZ10V2R",
    "kind": "definition",
    "msc": [
      "05C05"
    ],
    "name": "Binary tree",
    "sources": [
      {
        "locator": "Recursive definition",
        "url": "https://en.wikipedia.org/wiki/Binary_tree"
      }
    ],
    "tag": "02A8EMC83C"
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/02A8EMC83C/",
  "links": [
    {
      "field": "defines",
      "target": "0D7EZ10V2R"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/02A8EMC83C.md",
  "msc": [
    "05C05"
  ],
  "name": "Binary tree",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/02A/02A8EMC83C.md",
  "status": null,
  "tag": "02A8EMC83C",
  "uri": "m2://02A8EMC83C",
  "url": "https://math2.tamnd.com/wiki/binary-tree-definition/",
  "writing": {
    "tag": "02A8EMC83C",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
