Question: Asymptotic analysis for # 6 and # 7 : Determine the Big - Oh class of each algorithm. That is , formally compute the worst

Asymptotic analysis for #6 and #7: Determine the Big-Oh class of each algorithm. That is, formally compute the worst-case running time as we did on class using a table to produce a function that tracks the work required by all lines of code. Include all steps of the algebraic simplification, but you do not need to provide comments to justify each step.
Arithmetic mean = "add them all up, and divide by how many". Let the size of the problem n= the number of entries in the array.
# Input: an array A of real numbers
# Output: the arithmetic mean of the entries in the array
def arithmeticMean(A):
sum =0
count =0
for x in A :
sum +=x
count +=1
average = sum/count
return average
Sum of entries in an upper triangular nxn array. Let the size of the problem =n= the dimension of the nxn matrix.
# Input: an upper triangular square matrices A where all entries below the diagonal =0,
# and an integer n giving the dimension of this nxn matrix
# Output: a real number giving the sum of the entries
def UpperTriangularMatrixSum (A, n):
sum =0
for i in range (0,n) :
for j in range(i,n :
sum +=A[i][j]
return sum
 Asymptotic analysis for #6 and #7: Determine the Big-Oh class of

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!