2 Write a shared memory program to calculate Boolean AND A P

2) Write a shared memory program to calculate Boolean AND A) Pseudo Code with input is array A[o.N-11, output is Answer. Use the serial function AND(array) for load balancing, that takes in an array of size M, it returns the Boolean AND of that array and runs in time Q0M hrvauy o Answe printAnswe) ma, an elemen t5f -tne array to a diferent erngesser, hen they are Grs.ghed, rvn e ser. thus far Maf each elemen to yercube, they ah write lO /0

Solution

#include <iostream>
#include <cstdlib>
#include <string>
#include \"String.h\"
using namespace std;
int main (int argc, char **argv)
{
//Testing Default constructor, length, and print
String one;
cout << \"The length of String one is: \" << one.length() << endl;
cout << \"The value of String one is: \";
one.print();
  
//Testing Alternate constructor, length, and print
char test[256] = \"Hello world\";
String two(test);
cout << \"The length of String two is: \" << two.length() << endl;
cout << \"The value of String two is: \";
two.print();
  
//Testing the overloaded [] operator. This replaces your at() function.
cout << \"The first letter is: \" << two[0] << endl;
  
return 0;
}

 2) Write a shared memory program to calculate Boolean AND A) Pseudo Code with input is array A[o.N-11, output is Answer. Use the serial function AND(array) for

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site