Binary Search Tree

In computer science, a binary search tree (BST), which may sometimes also be called an ordered or sorted binary tree, is a node-based binary tree data structure which has the following properties:

  • The left subtree of a node contains only nodes with keys less than the node's key.
  • The right subtree of a node contains only nodes with keys greater than the node's key.
  • Both the left and right subtrees must also be binary search trees.
  • There must be no duplicate nodes.

Generally, the information represented by each node is a record rather than a single data element. However, for sequencing purposes, nodes are compared according to their keys rather than any part of their associated records.

The major advantage of binary search trees over other data structures is that the related sorting algorithms and search algorithms such as in-order traversal can be very efficient.

Binary search trees are a fundamental data structure used to construct more abstract data structures such as sets, multisets, and associative arrays.

Read more about Binary Search Tree:  Operations, Types

Famous quotes containing the words search and/or tree:

    The search for the truth is the most important work in the whole world, and the most dangerous.
    James Clavell (b. 1924)

    A tree is made to live in peace in the color of day and in friendship with the sun, the wind and the rain. Its roots plunge in the fat fermentation of the soil, sucking in its elemental humors, its fortifying juices. Trees always seem lost in a great tranquil dream. The dark rising sap makes them groan in the warm afternoons. A tree is a living being that knows the course of the clouds and presses the storms because it is full of birds’ nests.
    Jacques Roumain (1907–1945)