#merge-sort
26 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @mild grove! Please use
/closeor theClose Postbutton 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.
Please format your code to make it more readable.
For java, it should look like this:
```​​​`​java
public void foo() {
}
​​​`​```
isn't this the other way around for merge?
Wym exactly
becomes this {6,9,2,4,1,3} ```
if you mean merge
This message has been formatted automatically. You can disable this using /preferences.
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
Step by step instructions showing how to run merge sort.
Code: https://github.com/msambol/dsa/blob/master/sort/merge_sort.py (different than video, I added this retroactively)
Sources:
- Data Structures and Abstractions with Java by Frank M. Carrano [https://www.amazon.com/Structures-Abstractions-Whats-Computer-Science/dp/0134831691]
- http:...
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
💤 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.
.