Binary Search Tree data structures explained

A Binary Search Tree is a Binary tree in which all the nodes have following properties.

  • Left subtree of a node contains all the nodes having values lesser than the node.
  • Right subtree of a node contains all the nodes having values higher than the node.
  • Both the left and right subtree is also a Binary Search Tree.

As the name suggests, this data structure is mainly used for faster searching. In order to do that, restrictions are applied while inserting/deleting an element into the tree. As a result of these restrictions, worst case search time complexity remains at O(log n).

Below are some examples of Binary Search Trees.

(more…)
Binary Search Tree data structures explained Read More

Binary Search Tree Searching OF Node Explained With Simple Example

A Binary Search Tree is a Binary tree in which all the nodes has following properties.

  • Left subtree of a node contains all the nodes having values lesser than the node.
  • Right subtree of a node contains all the nodes having values higher than the node.
  • Both the left and right subtree is also a Binary Search Tree.

As the name suggests, this data structure is mainly used for faster searching. In order to do that, restrictions are applied while inserting/deleting an element into the tree. As a result of these restrictions, worst case search time complexity remains at O(log n). Before going ahead have a look into Binary Search Tree basics.

(more…)
Binary Search Tree Searching OF Node Explained With Simple Example Read More

Binary Search Tree Deletion Of Node Explained With Simple Example

A Binary Search Tree is a Binary tree in which all the nodes has following properties.

  • Left subtree of a node contains all the nodes having values lesser than the node.
  • Right subtree of a node contains all the nodes having values higher than the node.
  • Both the left and right subtree is also a Binary Search Tree.

As the name suggests, this data structure is mainly used for faster searching. In order to do that, restrictions are applied while inserting/deleting an element into the tree. As a result of these restrictions, worst case search time complexity remains at O(log n). Before going ahead have a look into Binary Search Tree basics.

(more…)
Binary Search Tree Deletion Of Node Explained With Simple Example Read More