Skip to content
Advertisement

Tag: treemap

Does using an Iterator over a TreeMap in Java interfere with the order of keys?

I want to know that if using an Iterator over a TreeMap in Java interfere with the order of keys? Answer From http://docs.oracle.com/javase/6/docs/api/java/util/TreeMap.html#keySet() : Returns a Set view of the keys contained in this map. The set’s iterator returns the keys in ascending order. If for some reason you need the keys in descending order, you can use descendingKeySet() If

Find element position in a Java TreeMap

I am working with a TreeMap of Strings TreeMap<String, String>, and using it to implement a Dictionay of words. I then have a collection of files, and would like to create a representation of each file in the vector space (space of words) defined by the dictionary. Each file should have a vector representing it with following properties: vector should

Advertisement