public void SuffixTreeTest4() { SuffixTree tree = new SuffixTree('$', "PREFIX"); SuffixTreeNodeTriplet[] expected = new SuffixTreeNodeTriplet[] { NonTerminal("EFIX$", "FIX$", "IX$", "PREFIX$", "REFIX$", "X$"), Terminal(2), Terminal(3), Terminal(4), Terminal(0), Terminal(1), Terminal(5), }; CollectionAssertEx.AreEqual(expected, tree.BFS()); }
public void SuffixTreeTest1() { SuffixTree tree = new SuffixTree('$', "tatat"); SuffixTreeNodeTriplet[] expected = new SuffixTreeNodeTriplet[] { NonTerminal("at", "t"), NonTerminal("$", "at$"), NonTerminal("$", "at"), Terminal(3), Terminal(1), Terminal(4), NonTerminal("$", "at$"), Terminal(2), Terminal(0), }; CollectionAssertEx.AreEqual(expected, tree.BFS()); }