Question: 8. (20 points) Find running time functions for the algorithms below and write their classification using Big-O asymptotic notation. A running time function should provide

 8. (20 points) Find running time functions for the algorithms below

8. (20 points) Find running time functions for the algorithms below and write their classification using Big-O asymptotic notation. A running time function should provide a formula on the number of operations performed on the variable s. Note that array indices start from 0. Algorithm Exl (A): Input: An array A storing n 1 integers. Output: The sum of the elements in A. 8+ AO for it to n-1 do 8+8+ Ai end for returns Algorithm Ex2 (A) : Input: An array A storing n 1 integers. Output: The sum of the elements at even positions in A. 8+ AO for it2 to n-1 by increments of 2 do 8+8+ Ail end for returns Algorithm Ex3 (A) : Input: An array A storing n 1 integers. Output: The sum of the partial sums in A. SO for it to n-1 do 8+8+ AO for j = 1 to i do 8 + 8 + A ) end for end for returns Algorithm Ex4 (A) : Input: An array A storing n 1 integers. Output: The sum of the partial sums in A. 80 for i=1 to n-1 do 868 + All tut+s end for returnt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!