-
Notifications
You must be signed in to change notification settings - Fork 9
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
hashes exercies #4
base: master
Are you sure you want to change the base?
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.
Well done Richelle, nice JavaScript solutions. You hit the learning goals here. Well done.
// Time Complexity: O(n + m log(m)) | ||
// Space Complexity: O(n) | ||
|
||
// n length of string | ||
// m length of longest word | ||
function 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.
👍
// This method will return the k most common elements | ||
// in the case of a tie it will select the first occuring element. | ||
// Time Complexity: ? | ||
// Space Complexity: ? | ||
function 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.
👍 Well done,
Space & time complexity?
} | ||
|
||
function subMatrixHelper(table, rowStart, colStart) { |
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.
I like the helper function here!
// Time Complexity: O(1) fixed size grid 9 x 9 | ||
// Space Complexity: O(1) also fixed, the sets would be max the same size as the grid since they are mapping each element | ||
|
||
function valid_sudoku(table) { |
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.
👍 Nice work Richelle!
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions