Develop a merging implementation based on the following idea to reduce the required extra space to max(M, N/M): For the purpose of simplicity, split the array into N/M blocks of size M and assume that N is a multiple of M. Following that, (i) use selection sort to order the blocks, treating them as items and using their first key as the sort key; and (ii) iterate over the array, merging the first block with the second, the second block with the third, and so on.
Develop a merging implementation based on the following idea to reduce the required extra space to max(M, N/M): For the purpose of simplicity, split the array into N/M blocks of size M and assume that N is a multiple of M. Following that, (i) use selection sort to order the blocks, treating them as items and using their first key as the sort key; and (ii) iterate over the array, merging the first block with the second, the second block with the third, and so on.
Develop a merging implementation based on the following idea to reduce the required extra space to max(M, N/M): For the purpose of simplicity, split the array into N/M blocks of size M and assume that N is a multiple of M. Following that, (i) use selection sort to order the blocks, treating them as items and using their first key as the sort key; and (ii) iterate over the array, merging the first block with the second, the second block with the third, and so on.
Develop a merging implementation based on the following idea to reduce the required extra space to max(M, N/M): For the purpose of simplicity, split the array into N/M blocks of size M and assume that N is a multiple of M. Following that, (i) use selection sort to order the blocks, treating them as items and using their first key as the sort key; and (ii) iterate over the array, merging the first block with the second, the second block with the third, and so on.
Develop a merging implementation based on the following idea to reduce the required extra space to max(M, N/M): For the purpose of simplicity, split the array into N/M blocks of size M and assume that N is a multiple of M. Following that, (i) use selection sort to order the blocks, treating them as items and using their first key as the sort key; and (ii) iterate over the array, merging the first block with the second, the second block with the third, and so on.

Step by step
Solved in 3 steps with 5 images









