Skip to content

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

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

Open
The-East-Wind opened this issue Jan 13, 2025 · 1 comment

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).

@atharva0711502
Copy link

Can i fix this.

atharva0711502 pushed a commit to atharva0711502/tech-interview-handbook that referenced this issue Mar 22, 2025
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

2 participants