Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct elemento * Unisci(struct elemento *top,struct elemento *top2)
- {
- struct elemento*Unione=NULL;
- if(top==NULL&&top2==NULL)
- {
- return Unione;
- }
- else if(top!=NULL&&top2!=NULL)
- {
- if(top->info<top2->info)
- {
- Unione=newelem(top->info);
- Unione->next=Unisci(top->next,top2);
- return Unione;
- }
- else
- {
- Unione=newelem(top2->info);
- Unione->next=Unisci(top,top2->next);
- return Unione;
- }
- }
- else if(top!=NULL && top2==NULL)
- {
- Unione=newelem(top->info);
- Unione->next=Unisci(top->next,top2);
- return Unione;
- }
- else if(top==NULL && top2!=NULL)
- {
- Unione=newelem(top2->info);
- Unione->next=Unisci(top,top2->next);
- return Unione;
- }
- return Unione;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement