emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[HW2] #184

Closed MimiOlayeye closed 3 years ago

MimiOlayeye commented 3 years ago

Hello, I'm not sure If concatenating the null character in the root node applies to my code. I passed all the cases when I tested my code myself, so I'm wondering what cases I failed when my code was tested?

On Line 147 of my code I have the method that returns the candidate word, I terminate the loop when node.getParent() == null so I'm pretty sure I'm not concatenating the null character.

My code: https://github.com/MimiOlayeye/dsa-java/blob/master/src/main/java/edu/emory/cs/trie/autocomplete/AutocompleteHW.java

marvinquiet commented 3 years ago

Hi,

First, your Extra failed at some point.

Second, for a prefix does not exist or the candidate as null, your code failed;

Third, it seems that for certain prefix, for example "study", you did not return studying into the list.

Those are all major logic problems.

MimiOlayeye commented 3 years ago

Thank you for getting back to me!