# Tree (data structure) facts for kids

In computer science, a **tree** is a graph data structure composed of items that have child items. Trees have an item called a root. No item has the root as a child. Trees may not have cycles. Items may contain a reference to their parent. An item is a leaf if it has no children. The height of an item is the length of the longest downward path to a leaf from that item. The height of the root is the height of the tree. The depth of an item is the length of the path to the tree's root.

## Example

- The item labeled 2 in green text is the root.
- The item labeled 4 is a leaf and its depth is 3.
- The height of the tree is 3.

## List of tree data structures

All content from Kiddle encyclopedia articles (including the article images and facts) can be freely used under Attribution-ShareAlike license, unless stated otherwise. Cite this article:

Tree (data structure) Facts for Kids. *Kiddle Encyclopedia.*