JAVA: RB Tree Map
Posted on 2011-10-27
I need to build my own Red Black tree class in Java. All the algorithms including get, put, remove, etc need to be based on 2-3-4 trees, but the overall structure has to look like a Red Black tree.
I'm not even sure where to begin. See what's needed below.
public void clear();
public boolean containsKey(Object key);
public boolean containsValue(Object value);
public V get(Object key);
public V put(K key, V value);
public V remove(Object key);
public int size();
public ArrayList display();
All of these functions must function as EXACT identical copies of those found in java.util.TreeMap. Your RBTreeMap must behave in exactly the same way, in all respects, that java.util.TreeMap would behave if substituted.