I have EPI version 1.3.1
In that, Can you clarify more on the problem of prefix of a string?
I was under the impression that a string s ="cat"has a prefix “ca” only if “caxxxxx” is preset in the set of strings D.
however I fail to understand how the book comes to this conclusion:
if s = "cat" and D = {"dog", "be", "cut"} return "ca"
if s = "cat" and D = {"dog", "be", "cut", "car"} return "cat"
if s = "cat" and D = {"dog", "be", "cut", "car", "cat"} return epsilon
epsilon is supposed to be empty string above.
Also the implementation of algorithm uses TrieNode.
However there is very limited explanation on the thought process behind the problem.
Could provide a better explanation?
Also is this version of EPI outdated? I saw someone else posted a query about 9.15 but that looks an altogether different problem. Should I buy a new one? Do you guys have a kindle edition?