emory-courses / dsa-java

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

[HW#2] PickCandidates questions #169

Closed TFloyd1989 closed 4 years ago

TFloyd1989 commented 4 years ago

I have a few questions about some pickcandidates logic. 1) If the prefix is an empty string, should we still store its last picked word(s)? 2) What should happen if the input is space, or only comprised of space characters? 3) Should we be prepared for inputs with non-alphabetical characters, like : or ) ?

marvinquiet commented 4 years ago

For question 1, if the prefix is empty, it depends on what you have from getCandicates when prefix is empty. Thus, it will become a combination of your getCandicates and your picked word; For question 2, Whitespaces are not allowed as input; thus, you should trim all input strings. as listed in the Homework Note; ~For question3, we only consider alphabetical input as a real dictionary.~

TFloyd1989 commented 4 years ago

For question 2, I was wondering if I could have a bit more clarification? Like if the prefix is " ", trim it to " " a space, or just make it an empty string?

jdchoi77 commented 4 years ago
  1. Yes
  2. Should be considered an empty string
  3. Any character should be acceptable