Difference between binary tree and binary search tree

Viewed 238725

Can anyone please explain the difference between binary tree and binary search tree with an example?

13 Answers

A tree can be called as a binary tree if and only if the maximum number of children of any of the nodes is two.

A tree can be called as a binary search tree if and only if the maximum number of children of any of the nodes is two and the left child is always smaller than the right child.

In a binary tree, each node has 2 child nodes the left node and the right node. A Binary Search tree is a special kind of tree in which the nodes are sorted, the left node is smaller than the parent node and the left node is bigger than the parent node. The binary tree allows duplicate values, Binary search tree doesn't allow duplicate values also carrying out any kind of operation is faster in Binary search tree than in Binary tree since BST is sorted

Related