Advertisement
Guest User

Untitled

a guest
Jul 9th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. void InsertSort(List* lst_ptr){
  2.    Node* i = lst_ptr->first->next;
  3.    Node* j;
  4.    int valor_atual, aux;
  5.  
  6.    while(i != NULL){
  7.     j = i->back;
  8.     valor_atual = i->info;
  9.     while((j != NULL) && (valor_atual < j->info)){
  10.         aux = j->info;
  11.         j->info = j->next->info;
  12.         j->next->info = aux;
  13.         j = j->back;
  14.     }
  15.     i = i->next;
  16.    }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement