Consider the following implementation of the contains method. How does it differ from the one we showed

Question:

Consider the following implementation of the contains method. How does it differ from the one we showed in Section 17.4 ? Is it better or worse, and why?

private boolean contains (IntTreeNode root, int value) { if (root = null) ( return false; } else if (value == root.data) { return true; } else { return contains (root.left, value) || contains (root.right, value);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: