CINXE.COM

tree

<!DOCTYPE HTML PUBLIC "-//IETF//DTD W3 HTML 2.0//EN"> <html lang="en-US"> <head> <title>tree</title> <meta name="description" content="Definition of tree, possibly with links to more information and implementations."> <meta name="keywords" content="tree"> <meta name="type" content="data structure"> <meta name="area" content="Trees"> <!-- turn off Microsoft's added smart tags --> <meta name="MSSmartTagsPreventParsing" content="TRUE"> <link rel="stylesheet" type="text/css" href="https://www.nist.gov/dads/dads.css"> </head> <body> <center> <a href="https://www.nist.gov/" target="_blank"><img src="../Images/webidblue_1linecentr.gif" border=0 height=43 width=229 alt="NIST"></a> </center> <h1>tree</h1> <p> (data structure) </p> <p> <strong>Definition:</strong> (1) A data structure accessed beginning at the <a href="root.html"><em>root</em></a> node. Each <a href="node.html"><em>node</em></a> is either a <a href="leaf.html"><em>leaf</em></a> or an <a href="internalnode.html"><em>internal node</em></a>. An internal node has one or more <a href="child.html"><em>child</em></a> nodes and is called the <a href="parent.html"><em>parent</em></a> of its child nodes. All children of the same node are <a href="sibling.html"><em>siblings</em></a>. Contrary to a physical tree, the root is usually depicted at the top of the structure, and the leaves are depicted at the bottom. (2) A <a href="connectedGraph.html"><em>connected</em></a>, <a href="undirectedGraph.html"><em>undirected</em></a>, <a href="acyclicgraph.html"><em>acyclic graph</em></a>. It is <a href="rootedtree.html"><em>rooted</em></a> and <a href="orderedtree.html"><em>ordered</em></a> unless otherwise specified. <br /> <img src="../Images/tree.png" height="219" width="318"> <br /> Thanks to Joshua O'Madadhain (jmadden@ics.uci.edu) for the figure, 6 October 2005. </p> <p> <strong>Formal Definition:</strong> (1) A tree is either <ul> <li>empty (no nodes), or <li>a root and zero or more subtrees. </ul> The subtrees are ordered. </p> <p> <strong>Specialization</strong> (... is a kind of me.)<br> <a href="heap.html"><em>heap</em></a>, <a href="btree.html"><em>B-tree</em></a>, <a href="binarytree.html"><em>binary tree</em></a>, <a href="balancedtree.html"><em>balanced tree</em></a>, <a href="multiwaytree.html"><em>multiway tree</em></a>, <a href="completetree.html"><em>complete tree</em></a>, <a href="searchtree.html"><em>search tree</em></a>, <a href="digitaltree.html"><em>digital tree</em></a>, <a href="MerkleTree.html"><em>Merkle tree</em></a>. </p> <p> <strong>See also</strong> other vocabulary: <a href="descendant.html"><em>descendant</em></a>, <a href="ancestor.html"><em>ancestor</em></a>, <a href="treeTraversal.html"><em>tree traversal</em></a>, <a href="height.html"><em>height</em></a>, <a href="depth.html"><em>depth</em></a>, <a href="degree.html"><em>degree</em></a> (3), technical terms: <a href="orderedtree.html"><em>ordered tree</em></a>, <a href="rootedtree.html"><em>rooted tree</em></a>, <a href="freetree.html"><em>free tree</em></a>, <a href="arborescence.html"><em>arborescence</em></a>. </p> <p> <em>Note: Appearing in the Dictionary of Computer Science, Engineering and Technology, Copyright &copy; 2000 CRC Press LLC. </p> <p> A tree in the data structure sense (1) is not the same as a tree in the graph sense (2). Consider possible <a href="binarytree.html"><em>binary trees</em></a> with two nodes. There are two possible data structures: a root and a left subtree or a root and a right subtree. However there is only one possible graph: a root and a subtree. The graph definition doesn't allow for "the subtree is the right subtree and the left subtree is empty". Also there is no "empty" graph tree. </p> <p> Thanks to Sharat Chandran (sharat@cs.umd.edu) for clarifying the difference between these two senses. </p> <p> The formal definition is after <a href="../terms.html#CLR90">[CLR90, page 94]</a>.</em> </p> <p>Authors: <a href="../Other/contrib.html#authorPEB">PEB</a>,<a href="../Other/contrib.html#authorCRC-A">CRC-A</a></p> <hr> Go to the <a href="https://www.nist.gov/dads/">Dictionary of Algorithms and Data Structures</a> home page. <hr> <p> If you have suggestions, corrections, or comments, please get in touch with <a href="mailto:paul.black@nist.gov">Paul Black</a>. </p> <p> Entry modified 15 December 2017.<br> HTML page formatted Wed Oct 30 12:15:31 2024. </p> <p> Cite this as:<br> Paul E. Black and Algorithms and Theory of Computation Handbook, CRC Press LLC, 1999, "tree", in <a href="https://www.nist.gov/dads/"><em>Dictionary of Algorithms and Data Structures</em></a> [online], Paul E. Black, ed. 15 December 2017. (accessed TODAY) Available from: <a href="https://www.nist.gov/dads/HTML/tree.html">https://www.nist.gov/dads/HTML/tree.html</a> </p> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10