Conversation
|
Grabbing this to grade! |
chimerror
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions