Guest Session: 1 Question Remaining. Create Account to save progress.
Login
Recursionmedium
0:00.0

Two algorithms have time complexities:

Algorithm X: TX(n)=TX(n−1)+2nT_X(n) = T_X(n-1) + 2^nTX​(n)=TX​(n−1)+2n with TX(0)=1T_X(0) = 1TX​(0)=1

Algorithm Y: TY(n)=4TY(n/2)+nT_Y(n) = 4T_Y(n/2) + nTY​(n)=4TY​(n/2)+n with TY(1)=1T_Y(1) = 1TY​(1)=1

Which algorithm is asymptotically faster for large nnn?