Question: Algorithm 2. MADEUPALGORITHM(A) Input: A, an n by n real valued matrix 1) Let B = an n by n matrix initially zero 2) Let

 Algorithm 2. MADEUPALGORITHM(A) Input: A, an n by n real valued
matrix 1) Let B = an n by n matrix initially zero
Algorithm 2. MADEUPALGORITHM(A)
Input: A, an n by n real valued matrix
1) Let B = an n by n matrix initially zero
2) Let s = 0
3) For i = 1 to n
4) For j = 1 to n
5) s = s + aij
6) End For
7) End For
8) s = s / n2
9) For i = 1 to n
10) For j = 1 to n
11) If aij > s Then bij = +1
12) If aij
13) End For
14) End For
Output: Matrix B
1.6) Compute the operator count T(n) for the algorithm. Count all variable accesses (read and writes), mathematical operators (additions, multiplications, etc...), loops etc... Show all of your working out. Only do calculations for the numbered lines.
1.7) Derive the Big-O for Algorithm 1.
1.8) What does the algorithm do?
1.9) What are the limitations of analysing the runtime of algorithms and why can Big-O notation be much more suited for this task?
please urgently needed all answers!!
Consider the Rowing algorithm Algorithm 2. MADEUSALGORITEM(A Input: A. annly real valued atrix 1) Let=ann by matrix initially to 2) let 3) Foxi - 1 ton 4) Yor=1 ton 5) ==o03 6) End Yor 7) End Yox 8) =>/ 9) Porton 10) Yoriton 11) TE >Then bis +1 12) TE Then bi-1 13) End Yos 14) End For Output: Matrix Within the algorithm the notation as used to indicate the element at the throw and the column of maroc vanable accesses (read and wittes) mathematical ope M Consider the following algorithm Algorithn 2. MADEOVALORETICA) Input: A. by real valued matrix 33 Lot Babystrix initially set 2) Leto 3 tilton 40 - 1 ton 5) 0 End To 23 End Tos 3 .. 3 TOEL=1 ton 303 TEO I Then - Then - 13 End To 14 End 5 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets go through the questions stepbystep 16 Compute the Operator Count Tn Counting operations involves counting each read write and arithmetic operati... View full answer

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!