Guest User

Untitled

a guest
Oct 2nd, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #define N 40
  2.  
  3. void sort(int Array[])
  4. {
  5.     int max=N;
  6.     int cur=0;
  7.     int min,i,temp;
  8.  
  9.     while(cur<max)          //cur: äußeres Konstrukt
  10.     {
  11.         min=cur;                //min: inneres Konstrukt
  12.  
  13.         for(i=cur+1; i < max; i++)
  14.         {
  15.             if(Array[i] < Array[min])
  16.             {
  17.                 min=i;
  18.             }
  19.         };
  20.         temp = Array[min];          //vertausche die Array-Elemente
  21.         Array[min]=Array[cur];
  22.         Array[cur]=temp;
  23.  
  24.         cur=cur+1;     //INC cur
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment