Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LISTE DUBLU INLANTUITE
- struct nodl {
- tip_informatie inf;
- nodl*ant,*urm;
- }
- nodl *prim,*ultim;
- CREARE:
- void adauga(nodl*&prim,nodl*&ultim,tip_informatie x)
- {
- if(prim==NULL)
- {
- prim = new nodl;
- prim->inf = x;
- prim->urm=NULL;
- prim->ant=NULL;
- ultim=prim;
- }
- else
- {
- nodl *p;
- p=new nodl;
- p->inf=x;
- p->urm=NULL;
- p->ant=ultim;
- ultim->urm=p;
- ultim=p;
- }
- }
- AFISARE:
- void afis(nodl*prim)
- {
- nodl *p;
- p=prim;
- while(p!=NULL)
- {
- cout << p->inf;
- p=p->urm;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement