I’m looking at some algorithms, and I’m trying to ascertain how multiple recursive steps are treated when forming the equation.
So exhibit A:

It is obvious to me that the recurrence equation here is: T(n) = c + 2T(n/2) which which in big O notation simplifies to O(n)
However here,
we have something similar going on as well and I get the recurrence equation T(n) = n + 2T(n/2) since we have two recursive calls not unlike the first one, which in big O notation simplifies to O(n), however that is not the case here. Any input as to how to get the correct recurrence equation in this second one over here?
Any input as to how to go about solving this would be brilliant.
You might be interested in the Master Theorem:
http://en.wikipedia.org/wiki/Master_theorem
The recurrence equation
T(n) = n + 2T(n/2)isTheta(n log n), which can be derived using the theorem. To do it manually, you can also assumen = 2^kand do: