Question: Q1) Consider the problem of finding the maximum element in an array of n integers. Sort the following steps to design an algorithm for this
Q1)
Consider the problem of finding the maximum element in an array of n integers. Sort the following steps to design an algorithm for this problem using a PRAM model with p processors where n is divisible by p and n> p.
Assign arrays to different processors.
Master processor find the maximum number.
Divide the array into p equal-sized arrays.
Processors find the maximum element in the array and store the result in an array of length p.
Q2)
What is the complexity of the above algorithm (write the equation without simplifying)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
