예제 #1
0
 static void Main( )
 {
     CharType a = new CharType( 'a' );
     List<CharType> b = new List<CharType>();
     b.Add(a);
     //
     SuffixTree tree = SuffixTreeHelper.BuildSuffixTree<CharType>(b, b);
     int result = SearchHelper.Search(b, tree);
     Console.WriteLine(result);
     //
     Node parent = new Node( 5 );
     Node son = new Node( ref parent, 9 );
     parent.AddChildren( ref son );
     foreach(var child in parent.GetChildren())
     {
         Console.WriteLine( child.GetParent().GetPositionInText() );
     }
     Console.ReadKey();
 }
예제 #2
0
 public void AddChildren(ref Node node)
 {
     _children.Add(node);
 }
예제 #3
0
 public void SetParent(ref Node parent)
 {
     _parent = parent;
 }
예제 #4
0
 public Node( ref Node parent)
 {
     _parent = parent;
 }
예제 #5
0
 public Node( ref Node parent, ref List<Node> children)
 {
     _parent = parent;
     _children = children;
 }
예제 #6
0
 public void AddNewNode(ref Node parent)
 {
     Node node = new Node(ref parent);
 }
예제 #7
0
 public void AddNewNode( ref Node parent, ref List<Node> children)
 {
     Node node = new Node(ref parent, ref children);
 }
예제 #8
0
 public SuffixTree(Node root)
 {
     Root = root;
 }