NNTP-Posting-Date: Sun, 25 Nov 2012 08:00:46 -0600 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: Subject: Re: SortedMap question? Date: Sun, 25 Nov 2012 14:00:50 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 15 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-UQQjYRZWGJS4bjnZZkg/G7x/ZI+o6IombgvWKwMWd19CMjC5n0zJBkdUkvjFdpzyzuelTtAOO6mgVHp!rZhk9s/s4w07NQUzHBeTHFdoROz0CHKE4le5OuZkDldAl5KJQLUUO7QtW7Tp5RKIPXhkON6FOaQ= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1650 Path: csiph.com!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail Xref: csiph.com comp.lang.java.programmer:19936 Knute Johnson wrote: > 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? Adding to the other responses: also hash-based algorithms are sensitive to the effectiveness of the hash function for the data you actually feed it. In some cases you might need a stronger bound on performance: preferring the guaranteed O(log N) of the tree over the /probably/ O(1) but /just maybe/ O(N) of the hash. -- chris