sort.c
changeset 74 829976007e62
parent 73 d0578510aea1
child 77 49e0babccb23
equal deleted inserted replaced
73:d0578510aea1 74:829976007e62
    25     return 0;
    25     return 0;
    26 }
    26 }
    27 
    27 
    28 void swap (int *v, int i, int j)
    28 void swap (int *v, int i, int j)
    29 {
    29 {
    30     int old = v[i];
    30     int old;
       
    31 
       
    32     if (i == j)
       
    33         return;
       
    34 
       
    35     old = v[i];
    31 
    36 
    32     v[i] = v[j];
    37     v[i] = v[j];
    33     v[j] = old;
    38     v[j] = old;
    34 }
    39 }
    35 
    40