Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- void adaugare(nod *&p,int x)
- {
- if(p==NULL)
- {
- p=new nod;
- p->info=x;
- p->urm=NULL;
- }
- else
- {
- nod *q=p;
- while(q->urm!=NULL)
- q=q->urm;
- nod *nou;
- nou=new nod;
- nou->info=x;
- q->urm=nou;
- q=nou;
- q->urm=NULL;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement