I am a bit confused because as pointed out in the comments, the intial conditions don't exactly make sense.
However, just taking T(2) = 1, we can obtain our result:
Since, $T(n) = 2*T(n/2) + 2 => T(n) = 2*(2*T(n/4) + 2) + 2 => T(n) = 2^2*T(n/2^2) + 2^2 + 2$
Proceeding further we get $T(n) = 2^2 * (2*T(n/2^3)+2) + 2^2 + 2 => T(n) = 2^3*T(n/2^3) + 2^3 + 2^2 + 2$
As you can see, the relation we get now is $T(n) = 2^k T(n/2^k) + 2 + 2^2 +...+2^k$
Now because I want to use the initial condition, let $n = 2^{k+1}$
Therefore, $T(n) = \frac{2^{k+1}}{2}T(\frac{2^{k+1}}{2^k}) + 2 + 2^2 +...+ 2^k$
Therefore, $T(n) = \frac{n}{2}T(2) + 2 + 2^2 +...+ 2^k$
Since, $2 + 2^2 +...+ 2^k$ is a geometric progression, using the formula for a geometric progression sum, we get $2 + 2^2 +..+2^k = \frac{2(1-2^k)}{1-2} = 2(2^k-1) = 2(\frac{n}{2} - 1)$
Using this result and the fact that T(2) = 1, we get $T(n) = \frac{n}{2}(1) + 2(\frac{n}{2}-1) = \frac{n}{2} + n - 2 = \frac{3n}{2} - 2$.
So the condition is that.
– Pygirl Jun 23 '18 at 14:58T(n) = 2T(n/2) + 2
After solving above recursion, we get
– Pygirl Jun 23 '18 at 14:59T(n) = 3n/2 -2