示例#1
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();
        }
示例#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
 static void Main(string[] args)
 {
     QuickSort.Client();
     Console.Read();
 }