Question

Given an array with elements {2,4,11,5,3,8,10,1,3,7,15,12} draw recursive tree using Mergesort algorithm and label steps.

Given an array with elements {2,4,11,5,3,8,10,1,3,7,15,12} draw recursive tree using Mergesort algorithm and label steps.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

I will describe steps of Merge sort before going into the recursive tree of merge sort.

A is the array

1) Get the middle point of the array, so that you can divide into two halves.

midPoint=(left+right)/2

2) Call merge sort for the first half of the array. Left array

sort(A,left,midPoint)

3) Call merge sort for the second half of the array.

sort(A,midPoint+1,right)

4) Merge two halves of the above.

merge(A,left,middle,right)

---------------------------------------------------------------------------------------------------------------------------------------------

Mergesort recursive tree: Generally recursive tree is for viewing the iterations. I will attach the image of the recursive tree for the Array, {2,4,11,5,3,8,10,1,3,7,15,12}

Please let me know if you find any difficulty in understanding the merge sort. Reply in comments, so that I can respond to your queries.

Add a comment
Know the answer?
Add Answer to:
Given an array with elements {2,4,11,5,3,8,10,1,3,7,15,12} draw recursive tree using Mergesort algorithm and label steps.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT