@dipit .. Yup you are correct..
Say, no of rows = M and no. of cols = N, Time complexity = sum over all i (1 to M} { N*(M+N-i) } = M * N * (M + 2N - 1) /2 On Jan 11, 2:19 pm, Dipit Grover <dipitgro...@gmail.com> wrote: > @Lucifer : I came up with a similar algorithm as yours but I dont > understand your complexity analysis : " sum over all i (1 to M} { i*(M+N-i)} > " . > > Shouldnt it be " M * sum over all i(1 to N) {(M+N-i)} " ? M= no of > columns, N= no of rows . Since we always have the min element at the 0th > column of the next row for each element of the current row. -- 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 algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.