Question: In java, create a AVLTreeMap. That is, create a map which depends on the self-balancing AVLTree. Below are five functions which need to be implemented

In java, create a AVLTreeMap. That is, create a map which depends on the self-balancing AVLTree. Below are five functions which need to be implemented into the program. The map interface and Node class are also given. \\Map.java Interface 
public interface Map { public int size(); public void put(String key, String value); public String get(String key); } 
class Node { String k; String val; int height; Node parent; // delete this variable for extra credit  Node left; Node right; public Node(String key, String value) { this.k = key; this.val = value; this.height = 1; this.parent = null; this.left = null; this.right = null; } public int balance() { // FIXME  return -1; } } 
 public AVLTreeMap() { // FIXME } public int size() { // FIXME  return -1; } public void put(String key, String value) { // FIXME } public String get(String key) { // FIXME  return null; } 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!