Q 12,14 explanation required

Q 12, 14 explanation required

Hey @jaankita2000 Q12 is just word play, best and efficient algorithm takes minimum processor time as well as space!
Q14. T(n) = T(n-1) + T(n-2) + T(n-3)
= 2T(n-2) + 2T(n-3) + T(n-4)
= 4T(n-3) + 3T(n-4) + 2T(n-5)…
which is n
T(1) + (n-1)T(2) + (n-3)T(3)
which is linear complexity. So ans is O(n)

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.