Exemplo n.º 1
0
        private void StrInp_Click(object sender, EventArgs e)
        {
            Random rand = new Random();
            int    size = Convert.ToInt32(sizeInp.Text);

            List <string>         List  = Comp.GetRSL(size, rand);
            UnsortedList <string> input = new UnsortedList <string>(List);

            Comp.OutPut(GenLB, List);
            Comp.Sort(input, cComB, cTrB, cComQ, cTrQ, BSortLB, QSortLB, timeLabB, timeLabQ);
        }
Exemplo n.º 2
0
        private void ManSortDouble_Click(object sender, EventArgs e)
        {
            string[]      s    = manInp.Text.Split('\r');
            List <double> list = new List <double>();

            for (int i = 0; i < s.Length; i++)
            {
                list.Add(double.Parse(s[i]));
            }

            UnsortedList <double> input = new UnsortedList <double>(list);

            Comp.OutPut(GenLB, list);
            Comp.Sort(input, cComB, cTrB, cComQ, cTrQ, BSortLB, QSortLB, timeLabB, timeLabQ);
        }
Exemplo n.º 3
0
        public void Sort <T>(UnsortedList <T> UnArr, Label cComB, Label cTrB, Label cComQ, Label cTrQ, ListBox BSortLB, ListBox QSortLB, Label timeLabB, Label timeLabQ)
        {
            Components Comp = new Components();

            BSort <T> bSort = new BSort <T>();

            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();

            List <T> listB = bSort.Sorting(Copy(UnArr.Input));

            stopWatch.Stop();
            TimeSpan ts = stopWatch.Elapsed;

            timeLabB.Text = string.Format("{0:00}:{1:00}.{2:00}", ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
            cComB.Text    = Convert.ToString(bSort.Sravn);
            cTrB.Text     = Convert.ToString(bSort.Perest);

            Comp.OutPut(BSortLB, listB);

            //--------------------------------------

            QSort <T> qSort = new QSort <T>();

            Stopwatch stopWatchQ = new Stopwatch();

            stopWatchQ.Start();

            List <T> listQ = qSort.Sorting(Copy(UnArr.Input));

            stopWatchQ.Stop();
            TimeSpan tsQ = stopWatchQ.Elapsed;

            timeLabQ.Text = string.Format("{0:00}:{1:00}.{2:00}", tsQ.Minutes, tsQ.Seconds, tsQ.Milliseconds / 10);
            cComQ.Text    = Convert.ToString(qSort.Sravn);
            cTrQ.Text     = Convert.ToString(qSort.Perest);

            Comp.OutPut(QSortLB, listQ);
        }