Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started