> For the complete documentation index, see [llms.txt](https://blog.sunilgudivada.dev/notebook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.sunilgudivada.dev/notebook/data-structures-and-algorithms/topics/binary-search-tree/2-3-tree.md).

# 2-3 Tree

2-3 tree is a way to generalize BSTs to provide the flexibility that we need to guarantee fast performance. In 2-node, we have one link for the keys that are less than the key in the node, and one link for the keys that are greater. In a 3-node, we need three links, one for less, one for between and one for greater.

![2-3 Tree](/files/8dmw9ZkYpNIS5zndVdRy)

Each transformation maintains the symmetric order and perfect balance

![](/files/QAkK2O1Wbr9G3Jcf8qHK)
