Advertisement
Guest User

Untitled

a guest
Oct 24th, 2013
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1.     Node* temp = NULL;
  2.     Node* current = head;
  3.     Node* next;
  4.     Node* point = head;
  5.     bool sorted = false;
  6.  
  7.     while(sorted){
  8.         sorted = false;
  9.         while (current != NULL){
  10.             next = current->next;
  11.             if (current > next){
  12.                 temp = current;
  13.                 current = next;
  14.                 next = temp;
  15.                 sorted = true;
  16.             }
  17.             current = current ->next;
  18.         }
  19.     }
  20.     return current;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement