@Mohit : Then insert all the elements in hashtable and scan the hashtable in O(n) time. While scanning each elements, you have to search for (sum-element) element in the hashtable (O(1) time). What do you think?
On Sun, Oct 24, 2010 at 12:51 PM, MOHIT .... <[email protected]> wrote: > @preetika : we can use hash table for O(n) complexity ..if array is not > sorted .. i am looking for that answer... how should i make that hash table > so that searching in hash table become O(1) complexity. > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- 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.
