Modify class Tree of Fig. 21.15 to include method contains, which attempts to locate a specified value

Question:

Modify class Tree of Fig. 21.15 to include method contains, which attempts to locate a specified value in a binary-search-tree object. The method should take as an argument a search key to locate. If the node containing the search key is found, the method should return a reference to that node’s data; otherwise, it should return null.

Fig. 21.15I // Fig. 21.15: Tree.java 2 // TreeNode and Tree class declarations for a binary search tree. 3 package

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

Step by Step Answer:

Related Book For  book-img-for-question

Java How To Program Late Objects Version

ISBN: 9780136123712

8th Edition

Authors: Paul Deitel, Deitel & Associates

Question Posted: