emory-courses / dsa-java

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

[HW#2] sorted getCandidate() #143

Closed caroltang0331 closed 3 years ago

caroltang0331 commented 3 years ago

can we assume the words are alphabetically inserted in the trie because the dict.txt is alphabetically ordered? I just want to make sure of the edge case that the list of words read and put in the trie could be randomly ordered unlike a normal dictionary.

marvinquiet commented 3 years ago

Hi, sorry that I did not quite understand why would the order affect the result? Are you concerning when traversing the nodes one-by-one to find the next character, it will affect the time complexity?

caroltang0331 commented 3 years ago

never mind it didn't affect my result. Sorry, I got it now.

marvinquiet commented 3 years ago

No worries! Glad to solve your problem!