Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribedimage text in transcribedimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

what is 2x10

Answered: 1 week ago