Merge Method Boundary Error
The following merge method contains a logical error in the calculation of the temporary subarray sizes. Which of the following statements correctly identifies the error?
A
The left subarray should start copying from index 1, not low.
B
The variable ‘k’ should be initialized to mid rather than low.
C
The size of the left subarray should be ‘mid - low + 1’ instead of ‘mid - low’.
D
The size of the right subarray should be ‘high - mid’ instead of ‘high - mid + 1’.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | mikaiya.beasley27 | 1 | 1 | 0m 16s | 84 |
| #2 | solsaloe | 0 | 1 | 0m 00s | -10 |
| #3 | gopangjan893 | 0 | 1 | 0m 06s | -16 |
| #4 | Potter16 | 0 | 1 | 0m 25s | -35 |
| #5 | jeonsaw1723 | 2 | 3 | 31m 39s | -1,709 |
| #6 | lsj08030922 | 1 | 1 | 31m 42s | -1,802 |
Items per page:
10
1 – 6 of 6
