-
Notifications
You must be signed in to change notification settings - Fork 41
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
Time - Denisse #24
base: master
Are you sure you want to change the base?
Time - Denisse #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall well done. You do need more practice looking at things in terms of time/space complexity. It's ok to guess at the answers here and state your reasoning. I can give you feedback then.
# Time Complexity: a lot | ||
# Space Complexity: O(n) | ||
|
||
def grouped_anagrams(strings) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time complexity 🤣
It's actually O(n) assuming the words are reasonably short O(n * mlog m) otherwise.
# Time Complexity: ? | ||
# Space Complexity: ? | ||
# resource: https://stackoverflow.com/questions/4264133/descending-sort-by-value-of-a-hash-in-ruby | ||
def top_k_frequent_elements(list, k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good that you cited your source. Time & space complexity?
Co-authored-by: Chris M <[email protected]>
Co-authored-by: Chris M <[email protected]>
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions