0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Merge Sort Algorithm

759

Published on

Demonstration of Merge Sort Algorithm by an example

Demonstration of Merge Sort Algorithm by an example

1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total Views
759
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
40
0
Likes
1
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array smallest smallest A A G L O R H I M S T
• 2. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G smallest smallest A G L O R H I M S T
• 3. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G H smallest smallest A G L O R H I M S T
• 4. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G H I smallest smallest A G L O R H I M S T
• 5. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G H I L smallest smallest A G L O R H I M S T
• 6. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G H I L M smallest smallest A G L O R H I M S T
• 7. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G H I L M O smallest smallest A G L O R H I M S T
• 8. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array A G H I L M O R smallest smallest A G L O R H I M S T
• 9. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array first half exhausted A G H I L M O R S smallest A G L O R H I M S T
• 10. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array first half exhausted A G H I L M O R S T smallest A G L O R H I M S T
• 11. Merging
• Merge.
• Keep track of smallest element in each sorted half.
• Insert smallest of two elements into auxiliary array.
• Repeat until done.
auxiliary array first half exhausted second half exhausted A G H I L M O R S T A G L O R H I M S T