#merge-sort

26 messages · Page 1 of 1 (latest)

mild grove
#

Man i have been sitting 4 hours trying to understand the merge part.

Assume we have {6,9,2,4,1,3}

Then it becomes {6} {9} {2} {4} {1} {3}

So wr have 6 arrays now? That are size of 1 how does the marge part happens

dusk kernelBOT
#

⌛ This post has been reserved for your question.

Hey @mild grove! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

dusk kernelBOT
mild grove
#

isn't this the other way around for merge?

mild grove
quasi mauveBOT
#
becomes this {6,9,2,4,1,3} ```
if you mean merge

This message has been formatted automatically. You can disable this using /preferences.

mild grove
#

the other way around for seperate

#

the question confuses me

#

Merge-sort first of all devides all the array then combines them

#

The seperated arrays i shown are the end result of the merge-sort

#

What i dont underdtand is the merging process

#

oh, first time seeing merge sort

#

interesting

#

Yeah i dont understand it very clear

#

seems like partition is simple enough

#

split it until it's the array is the size of 2

#

if [0] is more than [1], switch places. if it's not, remain as usual

#

merging seems a little different

mild grove
#

The marge-sort part stops when we reach all elemnets in an array with 1 or 0 but i do not understand how do they merge them

#

it's explained in the latter part

#

it's basically having two arrays, check which first of the array has less, then get the element with less and put it in another array

dusk kernelBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.

mild grove
#

.