I need to create a Hashmap that keeps track of the frequency of words in a BinarySearchTree.
How do i integrate the two to let the Hashmap know that its arguments are in the Tree?
Say my map is as follows:
Code:
// Initialize frequency table from command line
for (String a : args) {
Integer freq = m.get(a);
m.put(a, (freq == null) ? 1 : freq + 1);
}
System.out.println(m.size() + " distinct words:");
System.out.println(m);
Explanations of your methods are especially helpful.