Skip to content

I have a question in Java/Sorts/MergeSort.java #88

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

Closed
dumonody opened this issue Aug 23, 2017 · 3 comments
Closed

I have a question in Java/Sorts/MergeSort.java #88

dumonody opened this issue Aug 23, 2017 · 3 comments

Comments

@dumonody
Copy link

70.  while (i <= middle) {
71.             this.array[k] = this.tempMergArr[i];
72.             k++;
73.             i++;
74. }

Can I change this snippet to

while(j <= higherIndex){
           this.array[k] = this.tempMergArr[j];
           k++;
           j++;
}
@varunu28
Copy link
Contributor

varunu28 commented Aug 25, 2017

@dumonody I have made a PR for a generic version of MergeSort. Once it is merged we both can discuss on this. I have done a lot of changes so the previous code will be completely overwritten

#87

@dumonody
Copy link
Author

@varunu28 Sorry,my description is not correct. I want to ask, why out of the excess must be "i", not "j".

@Jeh212
Copy link

Jeh212 commented Jan 9, 2018

@dumonody to use the variable "j" as a counter, you will Need to declare the variable as an integer.

@varunu28 varunu28 closed this as completed Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants