We can use linked HashMap................ Refer : http://download.oracle.com/javase/6/docs/api/java/util/LinkedHashMap.html
On Mon, Sep 5, 2011 at 1:42 PM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > @Anup: > how can u say that the hash function used is a%10 .... > That is internal , not in the hands of user .. > Usually while inserting a value in Hash Table , we don't give the size of > the table ahead ... It decides some size, and implements.. when we cross the > assumed size,then it again gives some more memory so that all the operations > are optimum (less collisions)..... > > > On Sun, Sep 4, 2011 at 5:32 PM, Anup Ghatage <ghat...@gmail.com> wrote: > >> Sid, >> >> I'm afraid a hash table won't help much. >> >> Given the elements as follows: { 10,20,30,10,20,20,30,30,30,30,10 } >> >> All of them will be hashed into the 0'th cell for a % 10 hash function, >> and then probably the overflow will be handled by chaining. >> So that will be governed by m^2 in worst case. >> >> So the algorithm would be O( m^2 log m ) just to populate the hash and >> find the frequencies. >> >> -- >> Anup Ghatage >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > > **Please do not print this e-mail until urgent requirement. Go Green!! > Save Papers <=> Save Trees > *BharatKumar Bagana* > **http://www.google.com/profiles/bagana.bharatkumar<http://www.google.com/profiles/bagana.bharatkumar> > * > Mobile +91 8056127652* > <bagana.bharatku...@gmail.com> > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Thank You Rajeev Kumar -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.