emory-courses / dsa-java

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

[HW#2] Test output #156

Closed lcunild closed 3 years ago

lcunild commented 3 years ago

When I use the test program, my program returns exactly the same output as the expected output, however it still says fail. Screen Shot 2020-10-29 at 1 17 34 PM What could be causing this to happen?

lujiaying commented 3 years ago

Sorry I was wrong. Could you give some code snippets that I can take a look. In other words, the check condition statement.

lcunild commented 3 years ago

Here is my getCandidates method for Autocomplete: https://github.com/lcunild/dsa-java/blob/master/src/main/java/edu/emory/cs/trie/autocomplete/AutocompleteHW.java It is not finished yet, I am just trying to get it to work for the basic case, and then make it more robust once I know that my idea is correct. Here is the test program: https://github.com/lcunild/dsa-java/blob/master/src/test/java/edu/emory/cs/trie/autocomplete/AutocompleteTest.java

lcunild commented 3 years ago

I figured out the reason why, I had added a null character to the end of all my strings in the result. I have fixed it now.