He wants to sort some data.
He begins with, "hi I want to sort".
He later details that with, "Want to do this with the help of MERGE SORT".
- - - - - - - - - -
OK, here is MERGE SORT:
You could start with
https://duckduckgo.com/?q=merge+sort+algorithm&t=h_&ia=web , which from my experience are a lot of links to the wrong way to do things.
So, I looked through them and found
Wikipedia has a nice article on mergesort at
https://en.wikipedia.org/wiki/Merge_sort .
I suggest the Top-down implementation.
"A C++ program to Sort an array using merge sort algorithm", it seems OK.
https://www.simplilearn.com/tutorials/data-structure-tutorial/merge-sort-algorithm
There is a nice graphical representation, with pictures and easy to understand explainations at
https://www.enjoyalgorithms.com/blog/merge-sort-algorithm .
There is a little more complicated graphical representation at
https://www.tutorialspoint.com/data_structures_algorithms/merge_sort_algorithm.htm .
To bring all that together, there is another graphical explaination which might help you that you can find more about at
https://www.geeksforgeeks.org/merge-sort/
Quoted from that page:
• Declare left variable to 0 and right variable to n-1
• Find mid by medium formula. mid = (left+right)/2
• Call merge sort on (left,mid)
• Call merge sort on (mid+1,rear)
• Continue till left is less than right
• Then call merge function to perform merge sort.
Algorithm:
step 1: start
step 2: declare array and left, right, mid variable
step 3: perform merge function.
mergesort(array,left,right)
mergesort (array, left, right)
if left > right
return
mid= (left+right)/2
mergesort(array, left, mid)
mergesort(array, mid+1, right)
merge(array, left, mid, right)
step 4: Stop
Don's be a lurker sucking the life from this site by reading and rarely responding to an offer of a solution. If you are so smart that you would have thought something better, then answer better, don't suck entertainment from this site without giving a response to those posters that attempt to answer. A little encouragement goes a long way. A lot of negativity to a poster is seen as fear of them. Vote up or vote down, and if you vote down, tell technically why you voted down, don't be a sucking lurker. The owners of this site can remove your account the same as they can mine. Engage, don't just wallow in your own high status for actually your status does not belong to you.
Thank you.