@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 <[email protected]> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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* <[email protected]> -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
