If you store the squares of elements in a hash table, you dont need a binary search reducing the running time by a factor of log_base2(n)
On Wed, Dec 1, 2010 at 12:50 AM, Akash Agrawal <[email protected]>wrote: > Guys, > > I have written a blog post for finding triplets in an integer array A[] > which satisfy following condition: > > a[i]^2 + a[j]^2 = a[k]^2 > > > http://tech-queries.blogspot.com/2010/12/finding-triplets-in-integer-array.html > > I believe that more optimization are possible. It will be very helpful if > one can suggest some. > > > Regards, > Akash Agrawal > http://tech-queries.blogspot.com/ > > -- > 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.
