1 votes 1 votes Consider the algorithm that solves problems of size $n$ by recursively solving two sub problems of size $n-1$ and then combining the solutions in constant time. Then the running time of the algorithm would be: $O(n)$ $O(\log n)$ $O(n\log n)$ $O(n^2)$ Algorithms nielit-scb-2020 time-complexity + – gatecse asked Dec 9, 2020 • recategorized Jul 11, 2022 by Arjun gatecse 1.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes recurrence relation : T(n)=2.T(n-1)+c , n>0 T(n)=1, n=0. as per back substitution method, T(n) = 2$^k$.T(n-k)+ 2$^{k-1}$c+....+2$^0$c T(n) = 2$^n$.T(0)+ 2$^{k-1}$c+....+2$^0$c T(n) = 2$^{n+1}$-1 T(n) = O(2$^n$) Shaik Masthan answered Dec 10, 2020 Shaik Masthan comment Share Follow See all 0 reply Please log in or register to add a comment.