public int findMax() { *See BST.java for method specification */ /* Your code here */ return findMax_r(); // Dummy return statement. Remove when you implement! } private int findMax_r() { //code goes...


IN JAVA LANGUAGE


FILL OUT THE FIND MAX FUNCTION


public int findMax();
/* Returns the largest element in the tree.
* This method should call upon the recursive findMax_r() you write.
*
* @return the largest element in the tree (an int value)
* Example: findMax() will return 29 for the tree below
*
* (28)
* / \
* (14) (29)
* /
* (1)
*/


DO THIS BY CALLING A RECURSIVE FUNCTION


SHOULD RETURN LARGEST ELEMENT IN A BST


THANK YOU!!!!!


public int findMax() {<br>*See BST.java for method specification */<br>/* Your code here */<br>return findMax_r();<br>// Dummy return statement.<br>Remove when you implement!<br>}<br>private int findMax_r() {<br>//code goes here<br>

Extracted text: public int findMax() { *See BST.java for method specification */ /* Your code here */ return findMax_r(); // Dummy return statement. Remove when you implement! } private int findMax_r() { //code goes here
public class BSTIMP1 implements BST {<br>private Node root;<br>private int size;<br>public BSTImpl() {<br>root = null;<br>size = 0;<br>public BSTImpl(int val) {<br>this.root - new NodeImpl(val);<br>size = 1;<br>

Extracted text: public class BSTIMP1 implements BST { private Node root; private int size; public BSTImpl() { root = null; size = 0; public BSTImpl(int val) { this.root - new NodeImpl(val); size = 1;

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here