Beispiel #1
0
        public static long Btree_Test()
        {
            long t1;
            var  testAry = AryDeal.intBuild(0, 30000);

            t1 = TickCount.GetTickCount();
            CSolution.Btree_Create(testAry, testAry.Length);
            for (var i = 0; i < 30000; ++i)
            {
                CSolution.Btree_Insert(10000 - i);
                CSolution.Btree_Find(i);
                CSolution.Btree_Delete(i);
            }
            var rltAry = new int[CSolution.Btree_Count()];

            CSolution.Btree_Print(rltAry);
            CSolution.Btree_Clean();
            return(TickCount.GetTickCount() - t1);
        }
Beispiel #2
0
        public static long Btree_Test(int arysize, int inserttimes, int findtimes, int deletimes)
        {
            long t1;
            var  testAry = AryDeal.intBuild(0, arysize);

            t1 = TickCount.GetTickCount();
            CSolution.Btree_Create(testAry, testAry.Length);
            for (var i = 0; i < inserttimes; ++i)
            {
                CSolution.Btree_Insert(inserttimes - i);
            }
            for (var i = 0; i < findtimes; ++i)
            {
                CSolution.Btree_Find(i);
            }
            for (var i = 0; i < deletimes; ++i)
            {
                CSolution.Btree_Delete(i);
            }
            CSolution.Btree_Clean();
            return(TickCount.GetTickCount() - t1);
        }