> For the complete documentation index, see [llms.txt](https://catherine-leung.gitbook.io/data-strutures-and-algorithms/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://catherine-leung.gitbook.io/data-strutures-and-algorithms/definitions/tree-implementation.md).

# Binary Trees

A binary tree is a tree where every node has 2 subtrees that are also binary trees. The subtrees may be empty. The following is a binary tree:

![](https://cathyatseneca.gitbooks.io/data-structures-and-algorithms/content/assets/bst2.png)

Note that the term ***binary tree*** describes only the shape, it does not specify the ordering of values within the tree.

The following isn't (node with 2 has three subtrees)

![](https://cathyatseneca.gitbooks.io/data-structures-and-algorithms/content/assets/bst1.png)
