2 ms·
If it’s possible for the string to not be in the set then you have to look at all chars. Otherwise there are some cases you can skip characters. I generally d
by slededit 8y ago
If it’s possible for the string to not be in the set then you have to look at all chars.
Otherwise there are some cases you can skip characters. I generally don’t use this optimization when writing Tries because it’s tricky and rarely makes a difference.