-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Merge Sort Using recursion In Java #1437
Conversation
@iamrajiv @atarax665 kindly do go through my PR. |
Okay. Thank you for the insight! I'll change it right away.
…On Thu, 10 Dec, 2020, 12:48 PM Rajiv Singh, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In Java/README.md
<#1437 (comment)>
:
> @@ -138,6 +138,7 @@ _add list here_
- [PancakeSort](sort/PancakeSort.java)
- [Quick Sort](sort/QuickSort.java)
- [Selection Sort](sort/SelectionSort.java)
+- [Merge Sort Using Recursion](https://github.com/ErzaTitania-2001/NeoAlgo/blob/master/Java/sort/MergeSortRecursion.java)
It should be like this - [Merge Sort Using
Recursion](sort/MergeSortRecursion.java).
------------------------------
In Java/sort/MergeSortRecursion.java
<#1437 (comment)>
:
> @@ -0,0 +1,107 @@
+//merge sort using divide and conquer and recursion
+import java.util.Scanner;
+class MergeSortRecursion
+{
+
+ public static void sort(int arr[], int start, int end)
+ {
+ if(start==end) //base case
+ return;
+ else
+ {
+ // Find the mid of the array
+ int mid = (start + end) / 2;
@ErzaTitania-2001 <https://github.com/ErzaTitania-2001> Please avoid this
technique to find the mid element since this can cause an integer overflow.
Use this int int mid = start + ((end - start) / 2);.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1437 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOJCY2AONE7P6545LY7BW63SUBY2VANCNFSM4UTWYE7Q>
.
|
/changed done.
Changes done. Go through the PR as required. @iamrajiv @atarax665 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iamrajiv Changes added and updated!
Can we create another pull request without the current one being merged? @iamrajiv |
I've put up a pull request to add @ErzaTitania-2001! 🎉 |
Have you read the Contributing Guidelines on Pull Requests?
yes
Description
(Write your answer here.)
Checklist
README.md
and link to my code.Related Issues or Pull Requests
Merge Sort in JavaScript #1427
#1427
Labelled Java