/ Return all values in this OrderedMap as an ArrayList of Vs.
// The first value in the ArrayList (at get(0)) must be the one with
// the key that precedes all other keys. The last element in the
// ArrayList must be the one with the key that follows all other keys.
public ArrayList<V> valuesAsList()
so this is what I basically want to do. To put it in a simple way and more quick, I have to build a map node using binary search tree and in every of that node consists of a key and a value. The value is actually a bank account object. That's just an overview, if you want to see all the general assignment then just click on the link that I have provided
No, I don't want to see your assignment. If you can't post some code and ask a sensible question about it then please get lost. You have been mooching around these forums for the last week using the "stone soup" method of getting people to do your homework bit by bit and it's getting really tiresome.
sorry guys but so far this is my code:
// Return all values in this OrderedMap as an ArrayList of Vs.
// The first value in the ArrayList (at get(0)) must be the one with
// the key that precedes all other keys. The last element in the
// ArrayList must be the one with the key that follows all other keys.
public ArrayList<V> valuesAsList() {
ArrayList<V> temp = new ArrayList<V>();
MapNode t = root;
valuesAsList(temp, t);
return temp;
}
private void valuesAsList(ArrayList<V> t, MapNode x) {
t.add(x.value);
valuesAsList(t, x.left);
valuesAsList(t, x.right);
}
I don't know whether this does what the assignments want, it compiles though