Hi all, is there a way to optimize the speed of the insertions in a java.util.Collection by specifying the order of the items ?
For example
java.util.Set<String> set = java.util.TreeSet<String>();
will this solution:
set.add("A");
set.add("B");
set.add("C");
set.add("D");
set.add("E");
be faster than this one (random order) ?
set.add("E");
set.add("D");
set.add("C");
set.add("A");
set.add("B");
(and the same question for the other collections: HashMap, hastable...)
Thanks