correction: yes it O(1) space , as we can revert back the sum of rows(0 to 1 , 0 to 2 , 1 to 2 , 2 to 3 ,3 to 4 etc etc combination) in O(col) time.
On Wed, Jan 18, 2012 at 11:25 PM, atul anand <[email protected]>wrote: > @ sravanreddy001 : yes it O(1) space , as we can revert back the sum of > rows(0 to 1 , 0 to 2 , 1 to 2 , 2 to 3 ,3 to 4 etc etc combination) in > O(row) time. > actually that's the trick for converting O(n^4) to O(n^3) complexity. > > naive brute force seems O(n^6) to me. > > > > > On Wed, Jan 18, 2012 at 11:14 PM, sravanreddy001 <[email protected] > > wrote: > >> @atul: >> I got this now... very good one... the space is O(1) right, as what ever >> the the values we store in matrix, can be reverted back in similar way.. >> >> i haven't thought of the kadane's algo that comes within the inner loop, >> >> the O(n^4) solution i thought will search brutefocely in the inner loops, >> leading additional loop, also my new matrix construction goes along a >> different appraoch, where as yours is lot simple. >> >> Is the bruteforce solution for this O(n^6) ? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/algogeeks/-/F_WyacnfRp8J. >> >> 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. >> > > -- 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.
