I would like to calculate the complexity of an algorithm using the "inequality strategy".

This algorithm takes two integers as one entry. $ n, m $. In addition this algorithm is recursive and if we denote $ C_ {n, m} $ The number of operations that this algorithm performs for the entry. $ n, m $ We have the following inequality:

$$ C_ {n, m} leq C_ {n, (m-1)} + C _ (n-1), (m-1)} + O (1) $$

In addition, the algorithm ends for the entry: $ (0, k) $ Y $ (k, 0) $ for all $ k in mathbb {N} $ Y $ C_ {0, k} = O (1) $ Y $ C_ {k, 0} = O (1) $.

So now I need to somehow solve the inequality to get $ C_ {n, m} $ for all $ n, m $. However, I really do not know how to do this.

The problem is that I think that any function works. For example, if I say: $ C_ {n, m} = O (m) $ then it is tre since by unduction we have then:

$ C_ {n, m} leq O (m-1) + O (m-1) + O (1) = O (m-1) $

Also if I say that: $ C_ {n, m} = O (n) $ Then it also works since by induction:

$ C_ {n, m} leq O (n) + O (n-1) + O (1) $

So, what is the problem with what I am doing and how to solve this inequality to obtain the complexity of $ C_ {n, m} $ ?

Thank you !