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 size of the right subarray should be ‘high - mid’ instead of ‘high - mid + 1’.
C
The size of the left subarray should be ‘mid - low + 1’ instead of ‘mid - low’.
D
The variable ‘k’ should be initialized to mid rather than low.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | solsaloe | 0 | 1 | 0m 00s | -10 |
| #2 | jeonsaw1723 | 2 | 3 | 31m 39s | -1,709 |
| #3 | lsj08030922 | 1 | 1 | 31m 42s | -1,802 |
Items per page:
10
1 – 3 of 3
APFIVE