Question: 5. This problem considers the polyphase merge algorithm for external sorting as pre- sented in the lectures and in the lecture notes. Suppose we run

5. This problem considers the polyphase merge algorithm for external sorting as pre- sented in the lectures and in the lecture notes. Suppose we run this algorithm on the following input: (58, 76, 97, 18, 34, 25, 89, 82, 77, 64, 16, 15, 87, 56, 46, 67, 91, 17, 62, 48, 30] Assume that the number of items that we can hold in memory at one time is 4. (This parameter was called m in the lecture and the class notes.) (a) How many runs are created in Phase 1 if we run the simple version that does not use replacement selection? List the contents of each run. (b) How many runs are created in Phase 1 if we use replacement selection? List the contents of each run. 5. This problem considers the polyphase merge algorithm for external sorting as pre- sented in the lectures and in the lecture notes. Suppose we run this algorithm on the following input: (58, 76, 97, 18, 34, 25, 89, 82, 77, 64, 16, 15, 87, 56, 46, 67, 91, 17, 62, 48, 30] Assume that the number of items that we can hold in memory at one time is 4. (This parameter was called m in the lecture and the class notes.) (a) How many runs are created in Phase 1 if we run the simple version that does not use replacement selection? List the contents of each run. (b) How many runs are created in Phase 1 if we use replacement selection? List the contents of each run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
