Binary search tree: Difference between revisions

Content deleted Content added
Editing caption of Fig 1, which previously said "The leaves are not drawn", when they are in fact displayed (i.e. the nodes with values 1, 4, 7 and 13 are all leaves).
Line 16:
}}
 
[[File:Binary search tree.svg|right|upright=0.8|thumb|Fig. 1: A binary search tree of size 9 and depth 3, with 8 at the root. The leaves are not drawn.]]
 
In [[computer science]], a '''binary search tree''' ('''BST'''), also called an '''ordered''' or '''sorted binary tree''', is a [[Rooted tree|rooted]] [[binary tree]] [[data structure]] with the key of each internal node being greater than all the keys in the respective node's left subtree and less than the ones in its right subtree. The [[time complexity]] of operations on the binary search tree is [[Time complexity#Linear time|linear]] with respect to the height of the tree.