SHARE
TWEET

Untitled

a guest Jun 15th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct le{
  2. int value;
  3. struct le *next;
  4. };
  5. typedef struct le listenelement;
  6. typedef listenelement *list;
  7.      
  8. void insert(int v, list *l){
  9.     listenelement *new;
  10.     new = malloc(sizeof(listenelement));
  11.     new->value = v;
  12.     new->next = *l;
  13.     *l = new;
  14.      
  15. void sort(list *l, int m){
  16.   struct le *list = NULL;
  17.   struct le *m = *l;
  18.   while(m != NULL){
  19.     struct le *next = m->next;
  20.     insert(&list, m);
  21.     m = next;
  22.   }
  23.   *l = list;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top