Binary Search Trees

From

(Difference between revisions)
Jump to: navigation, search
(Created page with 'An important and frequently used application of a binary tree is a '''Binary Search Tree'''. A binary search tree contains data that is ''comparable'', for example numbers or tex...')
Line 2: Line 2:
binary search tree contains data that is ''comparable'', for example numbers or text, and has the
binary search tree contains data that is ''comparable'', for example numbers or text, and has the
following property:
following property:
 +
<br/><br/>
<quote>
<quote>
Binary Search Tree Property: If '''N''' is a node in the tree, and '''N''' contains data '''D''', then all nodes in the left subtree of '''N''' contain data that is less than or equal to '''D''' and all nodes in the right subtree of '''N''' contain data that is greater than '''D'''.
Binary Search Tree Property: If '''N''' is a node in the tree, and '''N''' contains data '''D''', then all nodes in the left subtree of '''N''' contain data that is less than or equal to '''D''' and all nodes in the right subtree of '''N''' contain data that is greater than '''D'''.
</quote>
</quote>

Revision as of 15:43, 28 March 2009

An important and frequently used application of a binary tree is a Binary Search Tree. A binary search tree contains data that is comparable, for example numbers or text, and has the following property:

<quote> Binary Search Tree Property: If N is a node in the tree, and N contains data D, then all nodes in the left subtree of N contain data that is less than or equal to D and all nodes in the right subtree of N contain data that is greater than D. </quote>

MediaWiki Appliance - Powered by TurnKey Linux