write an algorithm to test whether a binary tree


Write an algorithm to test whether a Binary Tree is a Binary Search Tree.

The algorithm to test whether a Binary tree is as Binary Search tree is as follows:

bstree(*tree)
{
while((tree->left !=null)&& (tree->right !=null))
 {
  if(tree->left < tree->root)
   bstree(tree->left);
  else
   return(1);
  if(tree->right > tree->root)
   bstree(tree->right);
  else
  return(1);
 }
 return(0);

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: write an algorithm to test whether a binary tree
Reference No:- TGS0282837

Expected delivery within 24 Hours