Finding ah...isnt that simple... you have to do a binary search for it... that means that if you're on step j in the for above...you will have to do (n-j)lg(n-j)computations well...I think it would bring the algorithm to a total of O(sum from j=0 to n of (n-j)lg(n-j)< O(n^2lgn) if anyone can improve or find a better way...
--~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---