M - algorithm corrections, C/C++ Programming

Assignment Help:

Of course it is C[i] = A[i] + B[i].It was a typing mistake,never mind. You just understand the concept.

27-1 b.

for grain-size=1

n=A.length

grain-size=1

r=n

for k=0 to n-1

spawn ADD-SUBARRAY(A,B,C,k+1,min((k+1),n)

)

sync

This will make n sub branches all to be executed in parallel and finally sync instruction will cause the flow of execution to be synchronized at that point.

27-1 C.

x1 is the constant to represent computational cost of spawning a new process. This step is executed (n/grain-size) number of times.
x2 is the constant to represent the computational cost of the addition operation. This step is executed (grain-size) number of times for each spawned preocess in parallel.

Hence total time for a parallel thread is x1(n/grain-size) + x2.(grainsize)


Related Discussions:- M - algorithm corrections

Padovan string, A Padovan string P(n) for a natural number n is defined as:...

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concate program 1 : package test

Decodethecode, decode smugglers are very smart in day by day

decode smugglers are very smart in day by day

C programming assignment, good night i have an assignment that i really nee...

good night i have an assignment that i really need help with. i have to create a struct file with tag name book to have members int book_id char isbn[255]

Define advantages of multi file program, Define Advantages of Multi File Pr...

Define Advantages of Multi File Program? The main merits of spreading a program across several files are: • Teams of programmers able to work on programs. Every programmer w

Explain different access specifiers in a class, Question 1 Create a class ...

Question 1 Create a class String which stores a string value. Overload ++ operator which converts the characters of the string to uppercase (toupper() library function of "ctype.h

Computer Science 101, This is what I need help with. "Create a program cre...

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

Advanced features of c, We are now quite happy to use the basic mathematica...

We are now quite happy to use the basic mathematical expressions, however in engineering we use scientific functions i.e Sin , Cos  , ln etc . Within C we have the following functi

Define array of structures, Define Array of Structures? An Array of Str...

Define Array of Structures? An Array of Structures is an assortment of the same data types which are declared as structures. It is useful to store large and different number of

Refactoring, Refactoring Project Description: TASK 1 - DESIGN ALGORIT...

Refactoring Project Description: TASK 1 - DESIGN ALGORITHM You are required to design a suitable solution algorithm by using structured chart, pseudocode or flowchart. Thi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd