Beispiel #1
0
 public static void QuickSort(int[] array, int left, int right)
 {
     if (right > left)
     {
         int i = (left + right) / 2;
         int j = QuickSortProgram.Partition(array, left, right, i);
         QuickSortProgram.QuickSort(array, left, j - 1);
         QuickSortProgram.QuickSort(array, j + 1, right);
     }
 }
Beispiel #2
0
    public static void QuickSort(System.Int32[] array, int left, int right)
    {
        int  V_0;
        int  V_1;
        bool V_2;
        // No-op
        int  expr01 = right;
        int  expr02 = left;
        bool expr03 = expr01 > expr02;
        int  expr05 = 0;
        bool expr06 = expr03 == (expr05 != 0);

        V_2 = expr06;
        bool expr09 = V_2;

        if (expr09)
        {
            goto IL_34;
        }
        // No-op
        int expr0D = left;
        int expr0E = right;
        int expr0F = expr0D + expr0E;
        int expr10 = 2;
        int expr11 = expr0F / expr10;

        V_0 = expr11;
        System.Int32[] expr13 = array;
        int            expr14 = left;
        int            expr15 = right;
        int            expr16 = V_0;
        int            expr17 = QuickSortProgram.Partition(expr13, expr14, expr15, expr16);

        V_1 = expr17;
        System.Int32[] expr1D = array;
        int            expr1E = left;
        int            expr1F = V_1;
        int            expr20 = 1;
        int            expr21 = expr1F - expr20;

        QuickSortProgram.QuickSort(expr1D, expr1E, expr21);
        // No-op
        System.Int32[] expr28 = array;
        int            expr29 = V_1;
        int            expr2A = 1;
        int            expr2B = expr29 + expr2A;
        int            expr2C = right;

        QuickSortProgram.QuickSort(expr28, expr2B, expr2C);
        // No-op
        // No-op
        IL_34 : return;
    }
Beispiel #3
0
 public static void QuickSort(System.Int32[] array, int left, int right)
 {
     if (!(right <= left))
     {
         int i = ((left + right) / 2);
         int j = QuickSortProgram.Partition(array, left, right, i);
         QuickSortProgram.QuickSort(array, left, (j - 1));
         QuickSortProgram.QuickSort(array, (j + 1), right);
     }
     else
     {
     }
 }
Beispiel #4
0
    public static void QuickSort(System.Int32[] array, int left, int right)
    {
        if (right <= left)
        {
            goto IL_28;
        }
        int V_0 = ((left + right) / 2);
        int V_1 = QuickSortProgram.Partition(array, left, right, V_0);

        QuickSortProgram.QuickSort(array, left, (V_1 - 1));
        QuickSortProgram.QuickSort(array, (V_1 + 1), right);
        IL_28 : return;
    }
Beispiel #5
0
    public static void QuickSort(System.Int32[] array, int left, int right)
    {
BasicBlock_15:
        if (right <= left)
        {
            goto BasicBlock_17;
        }
        goto BasicBlock_16;
BasicBlock_16:
        int i = ((left + right) / 2);
        int j = QuickSortProgram.Partition(array, left, right, i);

        QuickSortProgram.QuickSort(array, left, (j - 1));
        QuickSortProgram.QuickSort(array, (j + 1), right);
        goto BasicBlock_17;
BasicBlock_17:
        return;
    }
    public static void QuickSort(System.Int32[] array, int left, int right)
    {
IL_00:  // No-op
        IL_01 : int expr01   = right;
        IL_02 : int expr02   = left;
        IL_03 : bool expr03  = arg1 > arg2;
        IL_05 : short expr05 = 0;
        IL_06 : bool expr06  = arg1 == arg2;
        IL_08 : V_2          = arg1;
        IL_09 : bool expr09  = V_2;
        IL_0A : if (arg1)
        {
            goto IL_34;
        }
IL_0C:  // No-op
        IL_0D : int expr0D   = left;
        IL_0E : int expr0E   = right;
        IL_0F : int expr0F   = arg1 + arg2;
        IL_10 : short expr10 = 2;
        IL_11 : int expr11   = arg1 / arg2;
        IL_12 : V_0          = arg1;
        IL_13 : System.Int32[] expr13 = array;
        IL_14 : int expr14 = left;
        IL_15 : int expr15 = right;
        IL_16 : int expr16 = V_0;
        IL_17 : int expr17 = QuickSortProgram.Partition(arg0, arg1, arg2, arg3);
        IL_1C : V_1        = arg1;
        IL_1D : System.Int32[] expr1D = array;
        IL_1E : int expr1E   = left;
        IL_1F : int expr1F   = V_1;
        IL_20 : short expr20 = 1;
        IL_21 : int expr21   = arg1 - arg2;
        IL_22 : QuickSortProgram.QuickSort(arg0, arg1, arg2);
IL_27:  // No-op
        IL_28 : System.Int32[] expr28 = array;
        IL_29 : int expr29   = V_1;
        IL_2A : short expr2A = 1;
        IL_2B : int expr2B   = arg1 + arg2;
        IL_2C : int expr2C   = right;
        IL_2D : QuickSortProgram.QuickSort(arg0, arg1, arg2);
IL_32:  // No-op
IL_33:  // No-op
        IL_34 : return;
    }
Beispiel #7
0
    public static void QuickSort(System.Int32[] array, int left, int right)
    {
ConditionalNode_28:
BasicBlock_21:
        if (!(right <= left))
        {
            goto Block_26;
Block_26:
BasicBlock_22:
            int i = ((left + right) / 2);
            int j = QuickSortProgram.Partition(array, left, right, i);
            QuickSortProgram.QuickSort(array, left, (j - 1));
            QuickSortProgram.QuickSort(array, (j + 1), right);
            goto BasicBlock_23;
        }
        else
        {
            goto BasicBlock_23;
Block_27:
        }
BasicBlock_23:
        return;
    }
Beispiel #8
0
    public static void QuickSort(System.Int32[] array, int left, int right)
    {
        int  V_0;
        int  V_1;
        bool V_2;
        // No-op
        // Stack: {}
        int expr01 = right;
        // Stack: {expr01}
        int expr02 = left;
        // Stack: {expr01, expr02}
        bool expr03 = expr01 > expr02;
        // Stack: {expr03}
        int expr05 = 0;
        // Stack: {expr03, expr05}
        bool expr06 = expr03 == (expr05 != 0);

        // Stack: {expr06}
        V_2 = expr06;
        // Stack: {}
        bool expr09 = V_2;

        // Stack: {expr09}
        if (expr09)
        {
            goto IL_34;
        }
        // Stack: {}
        // No-op
        // Stack: {}
        int expr0D = left;
        // Stack: {expr0D}
        int expr0E = right;
        // Stack: {expr0D, expr0E}
        int expr0F = expr0D + expr0E;
        // Stack: {expr0F}
        int expr10 = 2;
        // Stack: {expr0F, expr10}
        int expr11 = expr0F / expr10;

        // Stack: {expr11}
        V_0 = expr11;
        // Stack: {}
        System.Int32[] expr13 = array;
        // Stack: {expr13}
        int expr14 = left;
        // Stack: {expr13, expr14}
        int expr15 = right;
        // Stack: {expr13, expr14, expr15}
        int expr16 = V_0;
        // Stack: {expr13, expr14, expr15, expr16}
        int expr17 = QuickSortProgram.Partition(expr13, expr14, expr15, expr16);

        // Stack: {expr17}
        V_1 = expr17;
        // Stack: {}
        System.Int32[] expr1D = array;
        // Stack: {expr1D}
        int expr1E = left;
        // Stack: {expr1D, expr1E}
        int expr1F = V_1;
        // Stack: {expr1D, expr1E, expr1F}
        int expr20 = 1;
        // Stack: {expr1D, expr1E, expr1F, expr20}
        int expr21 = expr1F - expr20;

        // Stack: {expr1D, expr1E, expr21}
        QuickSortProgram.QuickSort(expr1D, expr1E, expr21);
        // Stack: {}
        // No-op
        // Stack: {}
        System.Int32[] expr28 = array;
        // Stack: {expr28}
        int expr29 = V_1;
        // Stack: {expr28, expr29}
        int expr2A = 1;
        // Stack: {expr28, expr29, expr2A}
        int expr2B = expr29 + expr2A;
        // Stack: {expr28, expr2B}
        int expr2C = right;

        // Stack: {expr28, expr2B, expr2C}
        QuickSortProgram.QuickSort(expr28, expr2B, expr2C);
        // Stack: {}
        // No-op
        // Stack: {}
        // No-op
        // Stack: {}
        IL_34 : return;
        // Stack: {}
    }