Hi,

Write C++ program to check if a given binary tree is a binary search tree or not?

suggestions:
-------------

If the given binary tree is a Binary search tree, then the inorder traversal should output the elements in increasing order. We make use of this property of inorder traversal to check whether the given binary tree is a BST or not.

The problem here , if I print or insert the nodes according to InOrder Traversal to a buffer , then I can check the values by comparisons, and this final step will increase the complixity of the solution.

How can I do that in lower complixity, I mean without allocating a new buffer and traverse it.??

Thank you