top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is the difference between binary tree and binary search tree?

+1 vote
862 views
What is the difference between binary tree and binary search tree?
posted Jan 20, 2015 by Nikhil Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote
 
Best answer

Binary tree:

Tree where each node has up to two leaves.
A binary tree is simply a tree in which each node can have at most two children.

Example:

 1
 / \
2   3

A binary search tree

It is a binary tree in which the nodes are assigned values, with the following restrictions ;

-No duplicate values. 
-The left subtree of a node can only have values less than the node 
-The right subtree of a node can only have values greater than the node 

Example:

     2
    / \
   1   3
answer Jan 21, 2015 by Manikandan J
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...