Write a multithreaded algorithm (using our platform) to calculate the range of values in a given array of length n. (The range is defined to be the difference between the maxvalue and the minvalue.) Be sure not to have any race conditions that could affect the result. Analyze your algorithm for parallelism, showing your work.
Example: given A[0..n-1] = 3,9,8,7,2,4,3 the answer would be 7 since max is 9 and min is 2.