emory-courses / dsa-java

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

[QZ5] input cases #124

Closed zche377 closed 4 years ago

zche377 commented 4 years ago

Should we assume that each country name in the input String is a combination of independent words? Like, should we get "Canada" from "... aabbccCanada ..." ?

zche377 commented 4 years ago

Also, is it case sensitive?

lujiaying commented 4 years ago

Should we assume that each country name in the input String is a combination of independent words?

Trie is character-based. Introducing the idea of independent words is not necessary.

Also, is it case sensitive?

image

Please take a look at this picture and see the character stored in every node.

lujiaying commented 4 years ago

Similar to the "America" - "American" case mentioned in Textbook,

Like, should we get "Canada" from "... aabbccCanada ..." ?

The answer is yes.