Esempio n. 1
0
        public static long Onewaychainlist_Test(int arysize, int appendtimes, int deletimes,
                                                int inserttimes, int findtimes)
        {
            long t1;
            var  testary = AryDeal.intBuild(0, arysize);

            t1 = TickCount.GetTickCount();
            CSolution.Create_List(testary, testary.Length);
            for (var i = 0; i < appendtimes; ++i)
            {
                CSolution.List_Append(i);
            }
            for (var i = 0; i < deletimes; ++i)
            {
                CSolution.List_Delete(i);
            }
            for (var i = 0; i < inserttimes; ++i)
            {
                CSolution.List_Insert(i, i);
            }
            for (var i = 0; i < findtimes; ++i)
            {
                CSolution.List_Search(i);
            }
            CSolution.List_Clean();
            return(TickCount.GetTickCount() - t1);
        }
Esempio n. 2
0
        public static long Onewaychainlist_Test()
        {
            long t1;
            var  testary = AryDeal.intBuild(0, 10000);

            t1 = TickCount.GetTickCount();
            CSolution.Create_List(testary, testary.Length);
            for (var i = 0; i < 10000; ++i)
            {
                CSolution.List_Append(i);
                CSolution.List_Search(i);
                CSolution.List_Delete(i);
                CSolution.List_Insert(i, i);
            }
            var rltary = new int[CSolution.List_Count()];

            CSolution.List_Print(rltary, rltary.Length);
            CSolution.List_Clean();
            return(TickCount.GetTickCount() - t1);
        }