Пример #1
0
 public virtual void TestgetBiggestSmallest1WithDelete()
 {
     NeoDatis.Btree.IBTreeSingleValuePerKey btree = GetBTree(3);
     btree.Insert(1, "key 1");
     btree.Insert(2, "key 2");
     btree.Insert(3, "key 3");
     btree.Insert(4, "key 4");
     btree.Insert(5, "key 5");
     AssertEquals(5, btree.GetSize());
     AssertEquals("key 5", btree.GetBiggest(btree.GetRoot(), true).GetValue());
     AssertEquals("key 1", btree.GetSmallest(btree.GetRoot(), true).GetValue());
     AssertEquals(null, btree.Search(1));
     AssertEquals(null, btree.Search(5));
 }
Пример #2
0
        public virtual void TestgetBiggestSmallest1WithDelete2()
        {
            NeoDatis.Btree.IBTreeSingleValuePerKey btree = GetBTree(10);
            int size = 500000;

            for (int i = 0; i < size; i++)
            {
                btree.Insert(i, "key " + i);
            }
            AssertEquals(size, btree.GetSize());
            AssertEquals("key 499999", btree.GetBiggest(btree.GetRoot(), true).GetValue());
            AssertEquals("key 0", btree.GetSmallest(btree.GetRoot(), true).GetValue());
            AssertEquals(null, btree.Search(0));
            AssertEquals(null, btree.Search(499999));
        }