Skip to content

Makhabat - Cedar#67

Open
makhabatmaksatbekova wants to merge 1 commit intoAda-C16:masterfrom
makhabatmaksatbekova:master
Open

Makhabat - Cedar#67
makhabatmaksatbekova wants to merge 1 commit intoAda-C16:masterfrom
makhabatmaksatbekova:master

Conversation

@makhabatmaksatbekova
Copy link

Hash Table Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Why is a good Hash Function Important?
How can you judge if a hash function is good or not?
Is there a perfect hash function? If so what is it?
Describe a strategy to handle collisions in a hash table
Describe a situation where a hash table wouldn't be as useful as a binary search tree
What is one thing that is more clear to you on hash tables now

@chimerror
Copy link

Grabbing this to grade!

Copy link

@chimerror chimerror left a comment

Choose a reason for hiding this comment

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

Good work!

I see there's some weird failure happening with the automated tests running your code, but as I don't see any obvious reason why that would have been a result of your changes, I will not ding you for it.

Additionally, I added some comments about your complexity calculations, but as this demonstrates sufficient understanding of the material, this is good enough for a Green!

In the case of a tie it will select the first occuring element.
Time Complexity: ?
Space Complexity: ?
Time Complexity: O(n)

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 on line 37, which will take O(n * log(n)) time and thus dominate the O(n) parts of the algorithm. Thus, the correct time complexity here is O(n * log(n)).

Time Complexity: ?
Space Complexity: ?
Time Complexity: O(n^2)
Space Complexity: O(n)

Choose a reason for hiding this comment

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

These would be accurate answers if we allowed arbitrary boards of nxn (well, actually the space complexity would be O(n^2) too), but since we only accept 3x3 boards, the time and space used will be constant and we can instead say it is O(1) in both time and space.

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