Advertisement
mihaimarcel21

FAdaugareFinalLLDI

Apr 20th, 2021
707
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. void AdaugareFinal(nod * & prim, nod * & ultim, int x)
  2. {
  3.     nod* aux = new nod;
  4.     aux->info = x;
  5.     if(prim == NULL)
  6.     {
  7.         aux->pre = NULL;
  8.         aux->ant = NULL;
  9.         prim = aux;
  10.         ultim = prim;
  11.     }
  12.     else
  13.     {
  14.         aux->ant=ultim;
  15.         ultim->pre=aux;
  16.         aux->pre=NULL;
  17.         ultim=aux;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement