daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest May 16th, 2018 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. struct element *lista_dodaj_1(struct element *head, struct element *nowy)
  2. {
  3.     struct element *LP=NULL, *LG=NULL,*y;
  4.     LP=head;
  5.     while(LP!=NULL)
  6.     {
  7.         y = (struct element*)malloc(sizeof(struct element));
  8.         if(nowy->k<LP->k)
  9.         {
  10.             LG=lista_dodaj(LG,nowy);
  11.             y->k = LP->k;
  12.             LG=lista_dodaj(LG,y);
  13.             LP = LP->next;
  14.         }
  15.         else
  16.         {
  17.             y->k = LP->k;
  18.             LG=lista_dodaj(LG,y);
  19.             LP = LP->next;
  20.         }
  21.     }
  22.     LG=lista_odwroc(LG);
  23.     lista_wyswietl(LG);
  24.     return LG;
  25. };
RAW Paste Data
Top