Solving recurrence relation with different rules for odd and even n
When $n$ is odd, the recurrence can be unrolled:
$$
T(n) = T(n-1) + n = 2T\left(\frac{n-1}{2}\right) + (n-1)^2 + n.
$$
In total, we always have
$$
T(n) = 2T(\lfloor n/2 \rfloor) + \Theta(n^2).
$$
Applying the master theorem, we conclude that $T(n) = \Theta(n^2)$.