示例#1
0
        public void quick_test()
        {
            var root = new TstNode('h');
            root.Insert("hello");
            root.Insert("world");
            root.Insert("mind");
            root.Insert("gap");

            Assert.That(root.Search("hello"), Is.Not.Null);
            Assert.That(root.Search("beans"), Is.Null);
        }
示例#2
0
 private TstNode insertRightNode(char ch, TstNode node)
 {
     Interlocked.CompareExchange(ref node._right, new TstNode(ch), null);
     node = node._right;
     return node;
 }
示例#3
0
 private TstNode insertCenterNode(String word, int i, TstNode node)
 {
     Interlocked.CompareExchange(ref node._center, new TstNode(word[i]), null);
     node = node._center;
     return node;
 }