# 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)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://blog.sunilgudivada.dev/notebook/data-structures-and-algorithms/topics/binary-search-tree/2-3-tree.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
