Question: I have a java code to finish, and I have no idea how to write a parallel code. Can someone solve it? Here are the
I have a java code to finish, and I have no idea how to write a parallel code. Can someone solve it?
Here are the problem and some start code.



Directions: Submit your solutions using gitlab. You must fill out the partners form for para to get access to your repository. Choosing a partner is disabled, because these exercises are solo. EX12. getLongestSequence (20 points) Use the ForkJoin framework to write the following method in Java: public static int getLongestSequence (int val, int[] arr, int sequentialCutoff Returns the length of the longest consecutive sequence of val in arr. For example, if arr is [2, 17, 17, 8, 17, 17, 17, 0, 17, 1], then getLongestSequence (17, arr)3 and getLongestSequence (35, arr) 0. Your code must have O(n) work, (lgn) span, where n is the length of arr, and actually use the sequentialCutoff argument. We have provided you with an extra class SequenceRange. We recommend you use this class as your return value, but this is not required Directions: Submit your solutions using gitlab. You must fill out the partners form for para to get access to your repository. Choosing a partner is disabled, because these exercises are solo. EX12. getLongestSequence (20 points) Use the ForkJoin framework to write the following method in Java: public static int getLongestSequence (int val, int[] arr, int sequentialCutoff Returns the length of the longest consecutive sequence of val in arr. For example, if arr is [2, 17, 17, 8, 17, 17, 17, 0, 17, 1], then getLongestSequence (17, arr)3 and getLongestSequence (35, arr) 0. Your code must have O(n) work, (lgn) span, where n is the length of arr, and actually use the sequentialCutoff argument. We have provided you with an extra class SequenceRange. We recommend you use this class as your return value, but this is not required
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
