Nepedia
Back to Discover
Developing Reader
💻

Red–black tree

technology Maturity 7-9 Next article →

Computers use special trees to store information.

Red-black tree example with sockets
Red-black tree example with sockets

These trees use red and black colors. Each part of the tree is one color. The colors help keep the tree even.

BlackNode
BlackNode

If the tree gets messy, the computer changes the colors. It can also move the parts around. This keeps the tree balanced. A balanced tree helps the computer work fast. It makes finding things very quick.

Binary Tree Rotation (animated)
Binary Tree Rotation (animated)

Computers use these trees to stay organized.

72 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (11)
File:Red-black tree example with sockets.svg
Red-black tree example with sockets.svg
File:Red-black trees and 2–3–4 trees.svg
Red-black trees and 2–3–4 trees.svg
File:Binary Tree Rotation (animated).gif
Binary Tree Rotation (animated).gif
File:RedNode.svg
RedNode.svg
File:BlackNode.svg
BlackNode.svg
File:RedOrBlackNode.svg
RedOrBlackNode.svg
File:TriangleTop.svg
TriangleTop.svg
File:TriangleSubtree.svg
TriangleSubtree.svg
File:Check-green.svg
Check-green.svg
File:NilBlue.svg
NilBlue.svg
File:5 minimal red-black trees nN.svg
5 minimal red-black trees nN.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.