Question: Which of the following Java code snippets correctly checks if a binary tree is a binary search tree? a . boolean ISFun ( Node node,

Which of the following Java code snippets correctly checks if a binary tree is a binary search tree?
a.
boolean ISFun (Node node, int min) i
int max= size -1 ;
if (node == null)
return true;
if (node. key min & s node. key > max)
return false;
return ISFun (node; node. left, node. key-1) & &
ISFun (node: node. right, node. key+1) ;
b. boolean ISFun (Node node, int min) f
int max= size -1 ;
if ( node == null)
return true;
if (node. key min || node. key >max )
return false;
return ISFun (node: node. Ieft, min: node.key) &&
ISFun (node: node. right, mini node. key);
c. boolean ISFun(Node node, int min, int max)( if (node == nu11)
return true;
if (node. key min 1 node, key > max)
return false;
return ISFun(node: node. left, min, node.key-1) &&
ISFun (node: node. right, node. key+1, max );
d. boolean ISFun (Node node)1
if (node == nu11)
return true;
if (node. left null & &
node. left. key > node. key)
return false;
if (node, right I= null & &
node. right. key node, key)
return false;
return ISFun (node: node, left) &&
ISFun (node; node. right) ;
 Which of the following Java code snippets correctly checks if a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!