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

🌊 - Kim #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

🌊 - Kim #17

wants to merge 4 commits into from

Conversation

kimvitug05
Copy link

Hash Table Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Why is a good Hash Function Important? constant lookups
How can you judge if a hash function is good or not? when collisions are minimal
Is there a perfect hash function? If so what is it? https://imgur.com/a/oWL727A
Describe a strategy to handle collisions in a hash table Chaining: to store an element in the hash table you must insert it into a specific linked list.
Describe a situation where a hash table wouldn't be as useful as a binary search tree when elements need to be sorted
What is one thing that is more clear to you on hash tables now ⚙️ the inner workings of a hash ⚙️

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work Kim! You hit the learning goals and even got the bonus. Well done. I had a few minor comments, but this is great.

Comment on lines +4 to 6
# Time Complexity: O(n) where n is the number of chars
# Space Complexity: O(n) where n is the number of words
def grouped_anagrams(strings)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Interesting solution, the time complexity is O(n) if the words are pretty short, if they're unlimited in length the time complexity is O(nm) where m is the length of the longest string.

Comment on lines +24 to 26
# Time Complexity: O(n log n)
# Space Complexity: O(n)
def top_k_frequent_elements(list, k)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Well done

Comment on lines +57 to 59
# Time Complexity: O(1)
# Space Complexity: O(n)
def valid_sudoku(table)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I would say the time/space complexities are both O(1) since Sudoku never gets bigger than 9x9.

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

Successfully merging this pull request may close these issues.

2 participants