Skip to content
New issue

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

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

Already on GitHub? # to your account

Generic implementation of Merge Sort in Java #3

Closed
abranhe opened this issue Oct 19, 2018 · 3 comments
Closed

Generic implementation of Merge Sort in Java #3

abranhe opened this issue Oct 19, 2018 · 3 comments

Comments

@abranhe
Copy link
Owner

abranhe commented Oct 19, 2018

I have implemented the MergeSort algorithm, in which I have created a void sort(arr) method, that takes the array and sort it, I am repeating code for the method to pass the array parameter of Integers or Doubles. What about String, ... etc

This implementation works so far, but is there any way to implement this generically this algorithm?

Helpful links:

@pg8469
Copy link

pg8469 commented Oct 19, 2018

You can use generic data type which can take any Object which implements comparable

@rupeshA
Copy link

rupeshA commented Oct 28, 2018

@abranhe , I will try this one.

@abranhe
Copy link
Owner Author

abranhe commented Oct 28, 2018

@rupeshA there is a posible implementation going on already on #7 you can review it and help with it or implement generic for other algorithms, since other algorithms are implemented only for integers.

@abranhe abranhe closed this as completed Apr 20, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants