Conversation
|
Grabbing this to grade! |
chimerror
left a comment
There was a problem hiding this comment.
Good work!
I added some comments about some unused import statements, and your time complexity calculation for the anagrams problem. But, this shows sufficient demonstration of your knowledge of the material and that's good enough for a Green!
| @@ -1,19 +1,43 @@ | |||
|
|
|||
| from ntpath import join | |||
| from sqlalchemy import true | |||
There was a problem hiding this comment.
Looks like these import statements never got used, so you can remove them to keep the code clean as a good style practice.
| Space Complexity: ? | ||
| Time Complexity: O(n * m log m) | ||
| ^ Not sure on the time complexity. Here, n represents the number of words in the | ||
| input string, while m represents the length of an individual word. |
There was a problem hiding this comment.
This is correct!
However, we can make a simplifying assumption. Since we know the words are English words and English words do not get too long (about 5 letters per word on average), the effect they have on this algorithm is dwarfed by the number of words in the list (which could easily get in the hundreds and thousands for a big list).
Thus, we can just say this is O(n).
Hash Table Practice
Congratulations! You're submitting your assignment!
Comprehension Questions