use of org.trie4j.patricia.TailPatriciaTrie in project trie4j by takawitter.
the class IterateDoubleArrayNodesTest method test.
@Test
public void test() throws Exception {
Trie t = new TailPatriciaTrie();
for (String w : new String[] { "hello", "world", "java", "hell", "he" }) {
t.insert(w);
}
DoubleArray da = new DoubleArray(t);
Assert.assertTrue(da.contains("hello"));
Assert.assertEquals(15, da.nodeSize());
CountingVisitor c = new CountingVisitor();
Algorithms.traverseByBreadth(da.getRoot(), c);
Assert.assertEquals(15, c.getCount());
}
Aggregations