O ( n^2 ) soln can be done .... step : 1 . sort array in n*log(n) . 2. for every "C" from last find two number A & B such that A+B=C ... O( n^2 ) Total :- O(N^2)
can we improve it further ?? .... any help please .... On Wed, Jul 14, 2010 at 10:57 AM, Debajyoti Sarma <[email protected] > wrote: > An array contains the set of positive integer. Find the largest number > c such that c=a+b where a,b,c are distinct number of the set? > [Consider , reducing 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. > > -- siddharth shankar -- 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.
