Skip to content

Conversation

@stephaniejmars
Copy link

Hash Table Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Why is a good Hash Function Important? efficiency and collision prevention
How can you judge if a hash function is good or not? minimizes collisions, spreads out elements evenly
Is there a perfect hash function? If so what is it? No, nothing can guarantee no collisions
Describe a strategy to handle collisions in a hash table Chaining, linear probing, quadratic probing
Describe a situation where a hash table wouldn't be as useful as a binary search tree When maintaining ordered data
What is one thing that is more clear to you on hash tables now handling collisions

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.

Well done, you hit the learning goals Stephanie. Nice work.

Comment on lines +4 to 7
# Time Complexity: O(n) n being the quantity of strings
# Space Complexity: O(1) bc we are only creating one new hash

def grouped_anagrams(strings)

Choose a reason for hiding this comment

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

👍

Comment on lines +23 to 26
# Time Complexity: O(n log n)
# Space Complexity: O(n)
# not sure why this one is failing a test bc it returns the correct response in repl??
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.

👍

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