emory-courses / dsa-java

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

[HW2] Questions on speed and the return of getCandidates() #137

Closed chloeslam closed 3 years ago

chloeslam commented 3 years ago

Question 1: To assess our algorithm speed, will our program speed be compared to our classmates? (similar to how it was assessed for HW1?)

Question 2: If getCandidates() has the input prefix of "sh" and "sh" exists in the trie, should getCandidates() return "sh" as a candidate?

Abner3 commented 3 years ago

Answering Chloe's 2nd question, please read #134 .

chloeslam commented 3 years ago

@Abner3 Thank you for your referral! I think [ship, sheep, she] is a valid return because the most recent picked candidate was "ship", then the second most recently picked candidate was "sheep", and "she" the word that I chose to make the trie return first that was not recently picked

Abner3 commented 3 years ago

@chloeslam I realized my question is incomplete and confusing since there are two versions of getCandidates we can implement (regular versus extra credit implementation). I edited out the question since the updated HW2 page clarifies my initial question.

chloeslam commented 3 years ago

@Abner3 Sounds good. Yeah, I was going to comment question 3 out because the HW2 clarifies it too. Thank you!

lujiaying commented 3 years ago

If getCandidates() has the input prefix of "sh" and "sh" exists in the trie, should getCandidates() return "sh" as a candidate?

~Yes.~

lujiaying commented 3 years ago

Question 1: To assess our algorithm speed, will our program speed be compared to our classmates? (similar to how it was assessed for HW1?)

I have not received the rubrics at this moment. But I guess it could be highly likely that way.

chloeslam commented 3 years ago

@lujiaying Thank you for your clarification! A question about your first answer though, I thought "sh" would not be returned since issue #134 was discussed that "sh" would not be returned?

lujiaying commented 3 years ago

Thank you for your clarification! A question about your first answer though, I thought "sh" would not be returned since issue #134 was discussed that "sh" would not be returned?

In #134, "sh" not given in dictionary.txt, thus not exist in Trie tree.

In your case, you said "sh" is in Trie Tree. So following your assumption, the output is totally determined by the given dictionary.txt.

chloeslam commented 3 years ago

@lujiaying That makes sense. I appreciate your help so much, thank you!

Abner3 commented 3 years ago

Thank you for your clarification! A question about your first answer though, I thought "sh" would not be returned since issue #134 was discussed that "sh" would not be returned?

In #134, "sh" not given in dictionary.txt, thus not exist in Trie tree.

In your case, you said "sh" is in Trie Tree. So following your assumption, the output is totally determined by the given dictionary.txt.

I am looking at dict.txt and it has "sh" in it. https://raw.githubusercontent.com/emory-courses/dsa-java/master/src/main/resources/dict.txt

lujiaying commented 3 years ago

Thank you for your clarification! A question about your first answer though, I thought "sh" would not be returned since issue #134 was discussed that "sh" would not be returned?

In #134, "sh" not given in dictionary.txt, thus not exist in Trie tree. In your case, you said "sh" is in Trie Tree. So following your assumption, the output is totally determined by the given dictionary.txt.

I am looking at dict.txt and it has "sh" in it. https://raw.githubusercontent.com/emory-courses/dsa-java/master/src/main/resources/dict.txt

Oh that is a good point. I need to ask Dr. Choi's opinion to see what is the expected output.

Please temporarily follow the case/convention in Textbook (not output the word itself)

lujiaying commented 3 years ago

From Dr. Choi's comment:

those test cases as well as examples are dummies, not meant to be what's supposed to be implemented

That means if "sh" exists in dictonary.txt, please return it as well.

chloeslam commented 3 years ago

@lujiaying Thank you!