Question discussion

Two sorted arrays of sizes 7 and 5 are merged into one sorted array using the standard merge procedure. What is the maximum number of eleme…

974Medium DSSSB TGT Computer Science 0 replies 1 views
0

Two sorted arrays of sizes 7 and 5 are merged into one sorted array using the standard merge procedure. What is the maximum number of element comparisons required?

  • A10
  • B11
  • C12
  • D35
Correct answer: B

Explanation

Each comparison places one element, and the last element needs no comparison, so the worst case is m + n − 1 = 7 + 5 − 1 = 11.

Discussion 0

Nobody has replied yet. Start the discussion!