Consider the following Algorithm: Factorial (n){ if (n=1) return 1 else return (n * Factorial(n-1)) } Recurrence for the following algorithm is:

(A) T(n) = T(n-1) +1 (B) T(n) = nT(n-1) +1 (C) T(n)= T(n-1) +n (D) T(n)=T(n(n-1)) +1 [showhide type=”post” more_text=”►Correct Option” less_text=”Show less…”] Correct Option is: D [/showhide]

If algorithm A has running time 7n^2 + 2n + 3 and algorithm B has running time 2n^2, then?

(A) Both have same asymptotic time complexity (B) A is asymptotically greater (C) B is asymptotically greater (D) None of others [showhide type=”post” more_text=”►Correct Option” less_text=”Show less…”] Correct Option is: A [/showhide]