Advertisement
hocikto19

Insertsort

Jan 5th, 2014
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. void sort(char pole[]){
  2.     int i, j = 1;
  3.     char pom;
  4.     while (pole[j] != '\0'){
  5.         i = j;
  6.         while (i && pole[i] < pole[i - 1]){
  7.             pom = pole[i];
  8.             pole[i] = pole[i - 1];
  9.             pole[i - 1] = pom;
  10.             i--;
  11.         }
  12.         j++;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement