Professional Documents
Culture Documents
Lecture K Sorting
Lecture K Sorting
• To make room:
• Hold nextPos value in a variable
• Shuffle elements to the right until gap at right place
Overview:
• Split array into two halves
• Sort the left half (recursively)
• Sort the right half (recursively)
• Merge the two sorted halves