BINARY SEARCH TREE

  • similar to a binary tree , it may be empty
  • every node (or element) has distinct key value
  • its left sub tree key value is less than root key value  and right sub tree key value is more than root key value
  • nodes are searched according to key value
  • during search key value is compared with root node if greater then searched along right sub tree, if key  value is less it is searched along  left sub tree, if key =zero then searching node is absent in tree.
  • The resulting left sub tree and right subtree is also a Binary search tree
  • Its time complexity is O(n)
  • during searching it follows recursive algorithm

No comments:

Post a Comment