Question: Computer Science - algorithm Consider the following algorithm: % PRE: A is an nxn array, zero-indexed. sum = 0 for y = 0 to n-1
Computer Science - algorithm

Consider the following algorithm: % PRE: A is an nxn array, zero-indexed. sum = 0 for y = 0 to n-1 for x = y to n-1 sum = sum + A[y,x] end end % POST: sum contains the sum of the elements on or above % the main diagonal. Assuming each sum assignment takes time C, and each loop assignment takes time D, write down a summation expression for the total time requirement of the algorithm and evaluate to an algebraic expression, then simplify to a polynomial with variable n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
