Question: Q.1.(20 pnt.) Write the General case Best case. Worst case running times and the order of growth of the following algorithms. a) Algorithm Even_nurnbers(A[1.np 1.
Q.1.(20 pnt.) Write the General case Best case. Worst case running times and the order of growth of the following algorithms. a) Algorithm Even_nurnbers(A[1.np 1. sumo; 2140 3. While (in) 4. sumsum ADL 5 1+1 6. return sum General case: Best case: Worst case: b) Algorithm Sum(Af.n). [1 nl) 1 sume 2141 3 while (ADB) and (1) 4 sumsumADI 5 for ke 1 to sumesum-K) 7 8 retum sum General case Bost case Worst case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
