Пример #1
0
        private void quickSortBtn_Click(object sender, EventArgs e)
        {
            int[]     dizi = { 2, 17, -4, 42, 9, 26, 11, 3, 5, 28 };
            QuickSort QS   = new QuickSort();

            MessageBox.Show("Sıralanmadan Önce : " + Environment.NewLine + QS.PrintItems(dizi));
            QS.Sort(dizi);
            MessageBox.Show("Sıralandıktan Sonra : " + Environment.NewLine + QS.PrintItems(dizi));
        }
Пример #2
0
        private static void Generate(int scale)
        {
            QuickSort qs = new QuickSort(scale);

            qs.SetComparator((double a, double b) => a < b);
            qs.Seed();
            qs.Sort();

            XmlSerializer serializer = new XmlSerializer(typeof(QuickSortSnapShotsXML));
            TextWriter data = new StringWriter();
            serializer.Serialize(data, qs.GetSnapShotsXML());
            data.Close();

            TextWriter writer = new StreamWriter(BuildPath(OutputName));
            writer.Write("{0}{1}{2}", ReadTemplate(TemplateBeginName), data, ReadTemplate(TemplateEndName));
            writer.Close();
        }
Пример #3
0
        private static void Generate(int scale)
        {
            QuickSort qs = new QuickSort(scale);

            qs.SetComparator((double a, double b) => a < b);
            qs.Seed();
            qs.Sort();

            XmlSerializer serializer = new XmlSerializer(typeof(QuickSortSnapShotsXML));
            TextWriter    data       = new StringWriter();

            serializer.Serialize(data, qs.GetSnapShotsXML());
            data.Close();

            TextWriter writer = new StreamWriter(BuildPath(OutputName));

            writer.Write("{0}{1}{2}", ReadTemplate(TemplateBeginName), data, ReadTemplate(TemplateEndName));
            writer.Close();
        }