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

error: space complexity is mentioned as O(logn) instead of O(n) in Anagrams section of String #684

Open
The-East-Wind opened this issue Jan 13, 2025 · 0 comments

Comments

@The-East-Wind
Copy link

Issue

In the Anagrams section of the Strings cheatsheet the space complexity of the approach where sorting both the input strings to determine it they are anagrams or not is mentioned as O(logn) but the actual space complexity is O(n) (since we'll need 2 additional strings of size n for storing sorted copy of the 2 input strings).

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

1 participant