K
Knute Johnson
I have been operating under a mis-perception that a SortedMap would be
more quickly searched than an unsorted Map. More specifically that the
cost would come when adding an element to the SortedMap. I wrote a
little test program to measure the amount of time it took to look for
non-existent data in a Map and a SortedMap and it took somewhere between
twice and three times as long to look for the data in the SortedMap.
So am I know correct in thinking that the only real advantage of a
SortedMap is if you wish to iterate over the keys of the map in some order?
Thanks,
knute...
more quickly searched than an unsorted Map. More specifically that the
cost would come when adding an element to the SortedMap. I wrote a
little test program to measure the amount of time it took to look for
non-existent data in a Map and a SortedMap and it took somewhere between
twice and three times as long to look for the data in the SortedMap.
So am I know correct in thinking that the only real advantage of a
SortedMap is if you wish to iterate over the keys of the map in some order?
Thanks,
knute...