In this assignment, you will add several methods to the BinarySearch Tree. You should have completed the following three methodsin the lab:
- public void insert(Key key, Value value)
- public Value get(Key key)
- public void inorder(Node root)
For this assignment, you will implement the following:
- public void remove(Node root, Key key)
- public Key getMin(Node n)
- public Key getMax(Node n)
- public int height(Node n)
The main method contains the statements to check whether yourimplementation works. You need to change anything in the mainmethod.
code provided
import java.util.Scanner;
public class BST<Key extends Comparable<Key>, Value>{
private Node root; // root of binary searchtree
private class Node {
private Key key; // sorted bykey
private
PayPal Gateway not configured
PayPal Gateway not configured