Skip to main content

Merge sort on 47, 27, 56, 23, ...

Short answer

Merge sort recursively divides list into halves then merges sorted halves. The final sorted list is 3, 9, 11, 23, 27, 47, 56, 94.

Trace the sorting steps in merge sort for the data: 47, 27, 56, 23, 3, 9, 94, 11.

Merge sort splits the list in halves down to single elements and then merges sorted halves.

Dividing

47 27 56 23 3 9 94 11
47 27 56 23 | 3 9 94 11
47 27 | 56 23 | 3 9 | 94 11
47 | 27 | 56 | 23 | 3 | 9 | 94 | 11

Merging

StepMergeResult
1[47] + [27][27, 47]
2[56] + [23][23, 56]
3[3] + [9][3, 9]
4[94] + [11][11, 94]
5[27, 47] + [23, 56][23, 27, 47, 56]
6[3, 9] + [11, 94][3, 9, 11, 94]
7[23, 27, 47, 56] + [3, 9, 11, 94][3, 9, 11, 23, 27, 47, 56, 94]

Answer: 3, 9, 11, 23, 27, 47, 56, 94

✓ Answer checked by Claude Opus 5.5 (high effort)

All Data Structure and Algorithm chapter 7 questions →