close
The Wayback Machine - https://web.archive.org/web/20201103183751/https://github.com/TheAlgorithms/Java/pull/1696
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

added Anagram #1696

Closed
wants to merge 2 commits into from
Closed

added Anagram #1696

wants to merge 2 commits into from

Conversation

@Acentari
Copy link

@Acentari Acentari commented Oct 8, 2020

#1640

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

References

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}.
strings/Anagram.java Outdated Show resolved Hide resolved
Collections.sort(charsOfS1);
Collections.sort(charsForS2);
Comment on lines +37 to +38

This comment has been minimized.

@rbshealy

rbshealy Oct 9, 2020
Contributor

Do you need to re-assign both ArrayLists, or does this do it for you?

This comment has been minimized.

@Acentari

Acentari Oct 10, 2020
Author

This does it for me. If the the sorted ArrayLists are the same this means that the 2 Strings have got the same letters

@Acentari Acentari requested a review from rbshealy Oct 12, 2020
@rbshealy
Copy link
Contributor

@rbshealy rbshealy commented Oct 12, 2020

Thanks for your pull request. I just checked and we already have this algorithm almost exactly the same way you implemented it. I made a request on #1640 for the author to explain what specifically could be improved about this algorithm. If they end up responding you are free to create another PR making changes to the file we already have.

@rbshealy rbshealy closed this Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.