You are on page 1of 2

Section A - Q5)

Binary Search Tree

Binary search tree (BST) 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.

From the above properties it naturally follows that:

• Each node (item in the tree) has a distinct key.

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 their associated records.

Digital Search Tree

• A digital search tree is a binary tree in which each node contains one element.
• The element-to-node assignment is determined by the binary representation of the
element keys.
• We number the bits in the binary representation of a key from left to right beginning
at one. Ex: bit one of 1000 is 1, and bits two , three , four are 0.
• All keys in the left subtree of a node at level I have bit i equal to zero whereas those
in the right subtree of nodes at this level have bit i = 1.
• Root contains one dictionary pair (any pair)
• All remaining pairs whose key begins with a 0 are in the left subtree.
• All remaining pairs whose key begins with a 1 are in the right subtree.
• Left and right subtrees are digital subtrees on remaining bits.
Applications of BST and DST

• 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.
• Data / Grid Clustering algorithm uses a Digital Search Tree.
• Game Representation is achieved through Digital Search Tree.

You might also like