Skip to content

Fixes issue #2603: Implementation of Tree Sort and Generic Type BST #2638

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

Merged
merged 6 commits into from
Oct 20, 2021

Conversation

mdrpanwar
Copy link
Contributor

@mdrpanwar mdrpanwar commented Oct 16, 2021

Describe your change:

This PR makes the following contributions:

  • Adds a new algorithm Tree Sort under /Sorts (as assigned via this issue)

  • Adds a generic type implementation of BST under /DataStructures/Trees. The existing BST implementations used primitive type int, however, SortAlgorithm interface requires sorting for any type that extends the Comparable interface. Therefore, generic type implementation of BST was required to facilitate Tree Sort.

  • Adds proper package names to /DataStructures/Trees/BSTIterative and /DataStructures/Trees/BSTRecursive classes.

  • modify the class being used in main() function of /DataStructures/Trees/BSTRecursive from BSTIterative to BSTRecursive. Before this change, BSTRecursive was testing BSTIterative in its main() method which was clearly not correct.

  • Add an algorithm?

  • Fix a bug or typo in an existing algorithm?

  • Documentation change?

References

Issue #2603.

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Java files are placed inside an existing directory.
  • All filenames are in all uppercase characters with no spaces or dashes.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

@mdrpanwar mdrpanwar requested a review from siriak as a code owner October 16, 2021 07:58
@mdrpanwar
Copy link
Contributor Author

@siriak Please review this PR.

1 similar comment
@mdrpanwar
Copy link
Contributor Author

@siriak Please review this PR.

@siriak siriak merged commit ce53fee into TheAlgorithms:master Oct 20, 2021
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.

2 participants