[Home]Tree data structure

HomePage | Recent Changes | Preferences

A tree is a hierarchical data structure made up of nodes. Each node has zero or more child nodes, which are below it in the tree (in computer science, unlike in nature, trees grow down, not up). The node of which a node is a child is called its parent node. A child has only one parent. If the tree has a single node without a parent, this node is called the root node (or root). Nodes with no children are called leaf nodes.

There are many different ways to represent trees; common representations represent the nodes as records allocated on the heap with pointers to their children, their parents, or both, or as items in an array, with relationships between them determined by their positions in the array.

See also binary tree, heap, ordered tree data structure, hierarchical tree structure.


HomePage | Recent Changes | Preferences
This page is read-only | View other revisions
Last edited October 29, 2001 4:10 pm by Kragen (diff)
Search: