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

refactor heapsort to support generic #553

Merged
merged 7 commits into from
Oct 15, 2022

Conversation

phantomnat
Copy link
Contributor

@phantomnat phantomnat commented Oct 7, 2022

This PR is related to #419

Details:

  • Refactor heapsort to support generic

@tjgurwara99
Copy link
Member

You've broken another implementation. Please fix that.

@phantomnat
Copy link
Contributor Author

phantomnat commented Oct 7, 2022

Thank you for the suggestion. I brought back the heap code.

@tjgurwara99
Copy link
Member

Thank you for the suggestion. I brought back the heap code.

Then this PR is not solving the Issue that it claims to solve. If you added the old implementation back, you also need to add the old tests back. Making this a separate implementation of HeapSort with little benefit.

@phantomnat
Copy link
Contributor Author

I refactored it to shared the implementation of heaptifyDown.

Hopefully, this will make the heap more generic

sort/heapsort.go Outdated Show resolved Hide resolved
@tjgurwara99 tjgurwara99 merged commit 6e6d4d7 into TheAlgorithms:master Oct 15, 2022
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

Successfully merging this pull request may close these issues.

3 participants