-
Notifications
You must be signed in to change notification settings - Fork 77
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
Arcila Maple C16 #52
base: master
Are you sure you want to change the base?
Arcila Maple C16 #52
Conversation
Grabbing this to grade! |
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 work!
I added some comments about extraneous comments and your time complexity calculation for the Top-K problem, but otherwise this looks good enough for a Green.
# ["ate","eat","tea"], | ||
# ["nat","tan"], | ||
# ["bat"] | ||
# ] |
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.
As a style thing, you'll usually want to remove comments like this that are not really related to explaining why the code is designed a certain way.
|
||
|
||
# Input: nums = [1,1,1,2,2,3], k = 2 | ||
# Output: [1,2] |
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.
Same as above, you can probably remove comments like these after they've helped you write your code.
Time Complexity: ? | ||
Space Complexity: ? | ||
In the case of a tie it will select the first occurring element. | ||
Time Complexity: O(n) |
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.
Don't forget to account for the call to sorted
, which takes O(n * log(n)) time, and thus dominates the O(n) part of this algorithm giving a final time complexity of O(n * log(n)).
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions