Homework Solution: Please help with questions 2 and 3…

    Please help with questions 2 and 3 File Insert Design Layout References Mailings Review View Tell me what you want to do Home Cut Copy Fonmat Painter Share 1 AaBbCCD · 溜c Replace Paste 乍·凸 11.ITNormalJTNo Spac Heading Heading 2 Title Subtitle Subtle Erm Emphasis Select Clipboard Font Paragraph Styles Editing Problem 2. Matrix transposition is an operation which flips a matrix over its diagonal, i.e. it switches the row and column indices of the matrix by producing another matrix denoted as AT (see https:/len.wikipedia.org/wiki/Transpose) Consider the following parallel implementation of the matrix transposition operation: A is nxn matrix parfor i-2 to n for j-1 to i-1 swap Auand Au What is the running time, work, span and parallelism of this algorithm? Explain your answer Problem 3. Design a parallel algorithm input: array 시 Find: smallest element of n What is your algorithms running time, work, span and parallelism? Explain your for the following problem: Section: 1 Page 1 of 2 134 words ー+ 80%
    Matrix transposition is an operation which flips a matrix over its diagonal, i.e. it switches the row and column indices of the matrix by producing another matrix denoted as A^T (see https: /len.wikipedia.org/wiki/Transpose) Consider the following parallel implementation of the matrix transposition operation: A is nxn matrix parfor i = 2 to n for j = 1 to i-1 swap A_ij and A_ij What is the running time, work, span and parallelism of this algorithm? Explain your answer Design a parallel algorithm for the following problem: input: array A Find: smallest element of n What is your algorithm's running time, work, span and parallelism? Explain your answer

    Expert Answer

     
    Problem-2 RunningTime - is O(n^2)

    Please acceleration with questions 2 and 3

    File Insert Design Layout References Mailings Review View Tell me what you lack to do Home Cut Copy Fonmat Painter Share 1 AaBbCCD · 溜c Replace Paste 乍·凸 11.ITNormalJTNo Spac Heading Heading 2 Title Subtitle Subtle Erm Emphasis Select Clipboard Font Paragraph Styles Editing Problem 2. Matrix deflection is an performance which flips a matrix balance its divergent, i.e. it switches the tier and shaft indices of the matrix by pliant another matrix denoted as AT (behold https:/len.wikipedia.org/wiki/Transpose) Consider the subjoined analogous implementation of the matrix deflection performance: A is nxn matrix parrestraint i-2 to n restraint j-1 to i-1 swap Auand Au What is the floating age, labor, couple and analogousism of this algorithm? Explain your exculpation Problem 3. Design a analogous algorithm input: invest 시 Find: lowest component of n What is your algorithms floating age, labor, couple and analogousism? Explain your restraint the subjoined problem: Section: 1 Page 1 of 2 134 control ー+ 80%

    Matrix deflection is an performance which flips a matrix balance its divergent, i.e. it switches the tier and shaft indices of the matrix by pliant another matrix denoted as A^T (behold https: /len.wikipedia.org/wiki/Transpose) Consider the subjoined analogous implementation of the matrix deflection performance: A is nxn matrix parrestraint i = 2 to n restraint j = 1 to i-1 swap A_ij and A_ij What is the floating age, labor, couple and analogousism of this algorithm? Explain your exculpation Design a analogous algorithm restraint the subjoined problem: input: invest A Find: lowest component of n What is your algorithm’s floating age, labor, couple and analogousism? Explain your exculpation

    Expert Exculpation

     

    Problem-2

    RunningTime – is O(n^2)

    Reason :

    • 1st restraint loop executes upto n ages.
    • Restraint full i 2nd loop achieve executes (i-1) ages.i.e
      • When i=3 the loop achieve be performed (i-1)..i.e 2 ages => i (O(1)) + j(O(1)+….upto(i-1))
      • So restraint full ‘i’ 2nd loop achieve be performed ..When i=n the no of executions of 2nd loop achieve be 1(when i=3)+2(when i=4),..+n-2(when i=n)..the consolidate achieve be regular enjoy 1+2+3+–+n=[n(n+1)/2](If u retain the restraintmula of consolidate of n collection).
    • Threre restrainte the floating age is O(n^2)

    =================================================================================

    Problem 3

    Algorithm:

    • Read an invest ‘n’ which is of lenght n
    • intiate insignificant= n[0] //initating a inconstant denominated insignificant with primitive component of invest ‘n’.
    • restraint (i=0;i<n.length;i++) //restraint each component of n
      • if(n[i] < insignificant) //if prize at abjuration ‘i’ is close then insignificant inconstant
        • small=n[i] //store that abjuration prize into insignificant inconstant
    • object restraint
    • print insignificant
    • =====================================================================
    • At the object of restraint loop u achieve procure the insignificant prize of invest.

    Age complexity: O(n)

    Reason:As we are looping through the invest plow n ages to inhibit insignificant prize of invest..as n components were profitable.