public DiaryTrieNode SetChildCharacter(char character, string source)
        {
            var child = GetChild(character);

            if (child == null)
            {
                child = new DiaryTrieNode(character, Depth + 1);
                Children.Add(child);
            }

            child?.AddSource(source);
            return(child);
        }
Exemple #2
0
 public DiaryTrie()
 {
     _root = new DiaryTrieNode('.', 0);
 }