Exemplo n.º 1
0
        public void Test()
        {
            CArray array = CArray.InitInstanceByRand(SortData.SEED, SortData.COUNT);

            array.ISort = new CInsertionSortShell();

            Console.WriteLine("starting InsertionSortShell...\nbefore sort:");
            array.DisplayElements();

            #region 计时区间
            tim.StartTime();
            array.Sort();
            tim.StopTime();
            #endregion

            Console.WriteLine("\nafter insertion sort shell:");
            array.DisplayElements();
            Console.WriteLine("\ntime costed of insertion sort shell:" + tim.GetResult().Milliseconds + "ms");
        }
Exemplo n.º 2
0
 public void Sort(IComparer <T> aComparison)
 {
     CArray.Sort(m_Array, 0, m_Count, aComparison);
 }
Exemplo n.º 3
0
 public void Sort(int aIndex, int aCount, IComparer <T> aComparison)
 {
     CArray.Sort(m_Array, aIndex, aCount, aComparison);
 }
Exemplo n.º 4
0
 public void Sort()
 {
     CArray.Sort(m_Array, 0, m_Count);
 }