Which three insertions properly complete the pseudo-code?

Given the incomplete pseudo-code for a fork/join framework applications:
<code>
submit (Data) {
if (Data.size < SMALL_ENOUGH) {
_________(Data); // line X
}
else {
List<Data> x = _________________(Data); // line Y
for(Data d: x
______________(d); // line Z
}
</code>
And give the missing methods:
Process, submit, and splitInHalf
Which three insertions properly complete the pseudo-code?

Given the incomplete pseudo-code for a fork/join framework applications:

submit (Data) {
if (Data.size < SMALL_ENOUGH) {
_________(Data); // line X
}
else {
List<Data> x = _________________(Data); // line Y
for(Data d: x
______________(d); // line Z
}

And give the missing methods:
Process, submit, and splitInHalf
Which three insertions properly complete the pseudo-code?

A.
Insert submit at line X

B.
Insert splitHalf at line X

C.
Insert process at line X

D.
Insert process at line Y

E.
Insert splitHalf at line Y

F.
Insert process at line Z

G.
Insert submit at line Z

Explanation:
C: If Data.Size is “small enough” then process it directly.
E: Else we split it in half.
G: We use a recursive submit (of the splitted Data).



Leave a Reply 0

Your email address will not be published. Required fields are marked *