示例#1
0
        public void Sort()
        {
            ISort sortAlg = SortFactory.CreateSort(SortType.HeapSort);

            for (int i = 0; i < setsCount; i++)
            {
                int[] copy = dataSet.Select(a => a).ToArray();
                sortAlg.Sort(copy);
            }
        }
        public void Sort()
        {
            DataSetsThreadedSorter.finishedThreads = 0;

            ISort sortAlg = SortFactory.CreateSort(SortType.HeapSort);

            for (int i = 0; i < setsCount; i++)
            {
                int[]       copy    = dataSet.Select(a => a).ToArray();
                ThreadStart starter = delegate { ThreadSort(sortAlg, copy); };
                new Thread(starter).Start();
            }

            while (DataSetsThreadedSorter.finishedThreads < setsCount)
            {
                Thread.Sleep(100);
            }
        }