How to derive time complexity of the Recurrence Relation - T(n,m) = T(n-1,m) + T(n,m-1) + c

171 Views Asked by At

I know that, T(n,m) = T(n-1,m) + T(n,m-1) + c it's the recurrence equation of Longest Common Subsequence algorithm. And the time complexity of the LCS in case of recursive method is O(2^n+m).

The base condition is: when m or n = 0, T(m,n) = 1 i.e., T(0,n)=1 and T(m,0)=1.

But, how do I derive the time complexity from the above recurrence relation?