Copyright © Philip M. Parker, INSEAD. Terms of Use.

| Domain | Definition |
Computing | Binary tree (btree) A tree in which each node has at most two successors or child nodes. In Haskell this could be represented as data BTree a = NilTree | Node a (BTree a) (BTree a) See also balanced tree. (1994-11-29). Source: The Free On-line Dictionary of Computing. |
Math | A tree with at most two children for each node. (references) |
Source: compiled by the editor from various references; see credits. | |
(From Wikipedia, the free Encyclopedia)
Graph theorists use the following definition. A binary tree is a connected acyclic graph such that the degree of each vertex is no more than 3. A rooted binary tree is such a graph that has one of its vertices of degree no more than 2 singled out as the root. With the root thus chosen, each vertex will have a uniquely defined parent, and up to two children; however, so far there is insufficient information to distinguish a left or right child. If we drop the connectedness requirement, and there are multiple connected component in the graph, we call such a structure a forest.
Binary trees can be constructed from programming language primitives in several ways. In a language with structures and either pointers or references, binary trees are constructed by having a tree node structure which contains some data and pointers or references to its left child and its right child. The order this imposes on the children is sometimes useful, particularly for in-order traversal. Sometimes it also contains a pointer to its unique parent. If a node has less than two children, some of the child pointers may be set to a special null value, or to a special sentinel node.
Binary trees can also be stored in arrays, and if the tree is a complete binary tree, this method wastes no space, and the resulting data structure is called a heap. In this compact arrangement, a node has an index i, and (assuming zero-based arrays) its children are found at indices 2i+1 and 2i+2, while its parent (if any) is found at index floor(i/2). This method benefits from more compact storage and better locality of reference, particularly during a preorder traversal.
In languages with tagged unions such as ML, a tree node is often a tagged union of two types of nodes, one of which is a 3-tuple of data, left child, and right child, and the other of which is a "leaf" node, which contains no data and functions much like the null value in a language with pointers.
Often, one wishes to visit each of the nodes in a tree and examine the value there. There are several common orders in which the nodes can be visited, and each has useful properties that are exploited in algorithms based on binary trees.
Say we have a structure
This prints the values in the tree in pre-order. In pre-order, each node is visited either any of its children. Similarly, if the print statement was last, each node would be visited after all of its children, and the values would be printed in post-order.
Finally, an in-order traversal, as above, visits each node between the nodes in its left subtree and the nodes in its right subtree. This is a particularly common way of traversing a binary search tree, because it gives the values in increasing order.
In depth-first order, we always attempt to visit the node farthest from the root that we can, but with the caveat that it must be a child of a node we have already visited.
Add more hereMethods for storing binary trees
Methods of iterating over binary trees
Pre-order, in-order, and post-order traversal
TreeNode which contains a value value and references left and right to its two children. Then we can write the following function:
visit(TreeNode node) {
print node.value
if node.left != null then visit(node.left)
if node.right != null then visit(node.right)
}
visit(TreeNode node) {
if node.left != null then visit(node.left)
print node.value
if node.right != null then visit(node.right)
}
Depth-first order
Source: adapted by the editor from Wikipedia, the free encyclopedia under a copyleft GNU Free Documentation License (GFDL) from the article "Binary tree."
Crosswords: BINARY TREE |
| Specialty definitions using "BINARY TREE": balanced binary tree, balanced tree, BB tree, BD-tree, binary heap, binary search tree, binary tree representation of trees, BSP-tree ♦ complete binary tree ♦ extended binary tree ♦ Fibonacci tree, full binary tree ♦ Huffman coding ♦ Kraft's inequality ♦ perfect binary tree, PLOP-hashing ♦ search tree property, star-shaped polygon. (references) |
| The following statistics estimate the number of searches per day across the major English-language search engines as identified by various trade publications. Hyperlinks lead to commercial use of the expression at Amazon.com. |
| Expression | Frequency per Day |
binary tree | 51 |
binary tree c++ | 8 |
binary tree walking | 3 |
balanced binary tree | 2 |
| Source: compiled by the editor from various references; see credits. | |
| Language | Translations for "BINARY TREE"; alternative meanings/domain in parentheses. | ||||
Japanese Kanji | 二進木 , 二分木 . (various references) | ||||
Japanese Katakana | にし"ぎ, にぶ"ぎ. (various references) | ||||
Pig Latin | inarybay eetray | ||||
Scrabble® Enable2K-Verified Anagrams | |
| Words within the letters "a-b-e-e-i-n-r-r-t-y" | |
-2 letters: banterer, betrayer, retainer, teaberry. | |
-3 letters: arbiter, arenite, barnier, beanery, betaine, rarebit, rebater, reentry, reinter, rentier, retiary, retinae, retrain, tearier, ternary, terrain, terrane, terrine, trainee, trainer, trinary, yearner. | |
-4 letters: aerier, artery, artier, baiter, banter, barite, barren, barret, barter, baryte, beanie, bearer, beaten, beater, berate, betray, binary, binate, brainy, brayer, briary, briery, briner, byrnie, earner. | |
| Words containing the letters "a-b-e-e-i-n-r-r-t-y" | |
+2 letters: presbyterian. | |
+4 letters: corynebacteria, extraembryonic. | |
+5 letters: corynebacterial, corynebacterium, heartbreakingly, intracerebrally. | |
| Source: compiled by the editor from various references; see credits. SCRABBLE® is a registered trademark. All intellectual property rights in and to the game are owned in the U.S.A and Canada by Hasbro Inc., and throughout the rest of the world by J.W. Spear & Sons Limited of Maidenhead, Berkshire, England, a subsidiary of Mattel Inc. Mattel and Spear are not affiliated with Hasbro. | |
Hexadecimal (or equivalents, 770AD-1900s) (references)42 49 4E 41 52 59      54 52 45 45 |
| Leonardo da Vinci (1452-1519; backwards) (references)
|
Binary Code (1918-1938, probably earlier) (references)01000010 01001001 01001110 01000001 01010010 01011001 00100000 01010100 01010010 01000101 01000101 |
HTML Code (1990) (references)B I N A R Y   T R E E |
ISO 10646 (1991-1993) (references)0042 0049 004E 0041 0052 0059      0054 0052 0045 0045 |
Encryption (beginner's substitution cypher): (references)364348355259254523939 |
| 1. Crosswords 2. Expressions: Internet 3. Translations: Modern 4. Anagrams | 5. Orthography 6. Bibliography |
Copyright © Philip M. Parker, INSEAD. Terms of Use.