~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Tree data structure - Wikipedia

<<Up     Contents

Tree data structure

In computer science, a tree is a computer data structure that emulates a tree structure with a set of linked 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 at most one parent; a node without a parent is called the root node (or root). Nodes with no children are called leaf nodes.

In graph theory, a tree is a connected acyclic graph. A rooted tree is such a graph with a vertex singled out as the root. In this case, any two vertices connected by an edge inherit a parent-child relationship. An acyclic graph with multiple connected components or a set of rooted trees is sometimes called a forest.

In a tree data structure, there is no distinction between the various children of a node --- none is the "first child" or "last child". A tree in which such distinctions are made is called an ordered tree, and data structures built on them are called ordered tree data structures. Ordered trees are by far the commonest form of tree data structure.

Binary trees are one kind of ordered tree, and there is a one-to-one mapping between binary trees and general ordered trees.

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 (e.g., binary heap).

See also: binary space partition, heap

Related Topics

wikipedia.org dumped 2003-03-17 with terodump




 
 
4 carat RARE Honey Yellow Gold BASTNAESITE Facet Cab Rough Golden gemstone Faceting gem jewel PRETTY
 4 carat RARE Honey Yellow Gold BASTNAESITE Cab Golden ing jewel PRETTY 
 
29 carats Tigereye red yellow gold TigerIron Jasper gem tumble polished Cabbing cab tiger iron rough
 29 carats Tigereye red yellow gold TigerIron Jasper tumble polished Cabbing cab tiger iron  
 
35 carat grape STICHTITE gemstone Cabbing lapidary tumble polished rough gem stone jewelry 7 gram 2
 35 carat grape STICHTITE Cabbing lapidary tumble polished jewelry 7 gram 2 
 
33 carats blue Tanzanite zoisite rough crystal specimen jewelry cabbing gemstone 6 grams lot parcel
 33 carats blue Tanzanite zoisite crystal specimen jewelry cabbing 6 grams lot parcel 
 
Brilliant WHITE Clear TOPAZ jewel Loose natural cabochons cut polished jewelry gemstones 4x2 half mm
 Brilliant WHITE Clear TOPAZ jewel Loose cabochons cut polished jewelry 4x2 half mm