Exemple #1
0
    static void Main()
    {
        List <int> sortMe = new List <int>();

        sortMe.Add(2);
        sortMe.Add(89302);
        sortMe.Add(434);
        sortMe.Add(23);
        sortMe.Add(12);
        sortMe.Add(25);
        sortMe.Add(233);
        sortMe.Add(5542);
        sortMe.Add(22);
        sortMe.Add(23456);
        sortMe.Add(2);
        sortMe.Add(4);
        sortMe.Add(6);
        sortMe.Add(13456);
        sortMe.Add(43456);
        sortMe.Add(53456);


        quicksort x = new quicksort();

        x.sort(ref sortMe, 0, sortMe.Count - 1);
        foreach (int y in sortMe)
        {
            Console.Write(y);
            Console.Write(",");
        }
    }
 static void Main(string[] args)
 {
     int[] arr={22,4,17,2,98,54};
     int n=arr.Length;
     quicksort q=new quicksort();
     q.PrintArray(arr,n);
     q.Quicksort(arr,0,n-1);
     q.PrintArray(arr,n);
 }
    static void Main(string[] args)
    {
        int[]     arr = { 22, 4, 17, 2, 98, 54 };
        int       n   = arr.Length;
        quicksort q   = new quicksort();

        q.PrintArray(arr, n);
        q.Quicksort(arr, 0, n - 1);
        q.PrintArray(arr, n);
    }
Exemple #4
0
        //Used to test quick sort methods
        static public List <long> quicksortTest()
        {
            List <long> testList = new List <long>()
            {
                123432, 3456456, 768634, 23, 45, 567, 3243245, 5862, 3443436, 58657, 234234, 5689, 890, 32423423, 57, 342, 234345, 456, 5, 678, 234, 234, 456, 567
            };
            List <long> newTestList;

            newTestList = new quicksort(testList).getList();

            return(newTestList);
        }