There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. C.A.R. Hoare

Validate BST

Language Java | Level Intermediate | Category Data structure | September 6, 2015 7:56 am


Data structure Description

Write a program to validate the binary search tree. If it is valid binary search tree returns true; otherwise return false. If binary search tree left node value is greater than or equal to the root node and right node value is less than or equal to the root node is a valid binary search tree.


Output

   					 

All Binary Tree Values: 1 2 3 4  
Validate: true

				    

Comments


No comments available!

Please login to add comments.