Question: What does the following mystery method do? Give a very short description of what the method retums (not how it does it). Assume the Node

What does the following mystery method do? Give a very short description of what the method retums (not how it does it). Assume the Node is a binary search tree and make sure this is relevant to your answer class Node int value; Node left; Node right; static int mystery (Node n) if (n. left- null) if (n.left.leftnull && n.left.right null) return mystery(n.left); throw new IllegalArgumentException ) return leftmost (n.right); return n.value; // return leftmost descendant of in static int leftmost (Node n) [ if (n--null) if (n. left- null) return leftmost (n.left); throw new IllegalArgumentException ) return n.value
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
