gmamaladze / trienet

.NET Implementations of Trie Data Structures for Substring Search, Auto-completion and Intelli-sense. Includes: patricia trie, suffix trie and a trie implementation using Ukkonen's algorithm.
MIT License
425 stars 67 forks source link

Only one search result instead of two #13

Open Konard opened 5 years ago

Konard commented 5 years ago
var trie = new SuffixTrie<int>(3);

trie.Add("hello", 1);
trie.Add("world", 2);
trie.Add("hell", 3);

var result = trie.Retrieve("ll");

The result has only 1 as an element, however, there should be 1 and 3 as results. And if you replace trie.Add("hell", 3) with trie.Add("hell3", 3), it works as expected (1, 3 are results).