Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Merge Sort #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Merge Sort
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Think of it as a recursive algorithm continuously splits the array in half until it cannot be further divided.
This means that if the array becomes empty or has only one element left, the dividing will stop, i.e. it is the base case to stop the recursion.
If the array has multiple elements, split the array into halves and recursively invoke the merge sort on each of the halves. Finally, when both halves are sorted, the merge operation is applied.
Merge operation is the process of taking two smaller sorted arrays and combining them to eventually make a larger one.