Skip to content

Conversation

@nidhiparixitpatel
Copy link

Hash Table Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Why is a good Hash Function Important? A good hash function avoids collisions
How can you judge if a hash function is good or not? They should be consistent, the same key should have the same index. They should be quick O(1).
Is there a perfect hash function? If so what is it? No, but there are hash functions that work really really well.
Describe a strategy to handle collisions in a hash table If there is a collision in a hash table, one strategy is to make each bucket of the hash table's internal array the head of a linked list
Describe a situation where a hash table wouldn't be as useful as a binary search tree If sorting matter or if there is no unique key, a binary search tree may be more useful.
What is one thing that is more clear to you on hash tables now how they work!

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.

Thanks for getting this in. You hit the learning goals here and I like what you have so far on Sudoku. It looks like a good approach. Take a look at my comments and let me know if you have questions.

Great work!

Comment on lines +76 to +77
for i < table.length
for j < table.length

Choose a reason for hiding this comment

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

I think you are confusing Ruby with something else here. Maybe you meant a while loop?

# row, column or 3x3 subgrid
# Time Complexity: ?
# Space Complexity: ?
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 think you are on to something with this approach

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