nerdexam
Oracle

1Z0-805 · Question #66

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)…

The correct answer is C. Insert process at line X E. Insert splitHalf at line Y G. Insert submit at line Z. 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).

Concurrency

Question

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?

Options

  • AInsert submit at line X
  • BInsert splitHalf at line X
  • CInsert process at line X
  • DInsert process at line Y
  • EInsert splitHalf at line Y
  • FInsert process at line Z
  • GInsert submit at line Z

How the community answered

(30 responses)
  • B
    3% (1)
  • C
    80% (24)
  • D
    10% (3)
  • F
    7% (2)

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).

Topics

#fork/join framework#pseudo-code#divide and conquer#RecursiveTask

Community Discussion

No community discussion yet for this question.

Full 1Z0-805 Practice