Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. struct elemento * Unisci(struct elemento *top,struct elemento *top2)
  2. {
  3. struct elemento*Unione=NULL;
  4. if(top==NULL&&top2==NULL)
  5. {
  6. return Unione;
  7. }
  8.  
  9. else if(top!=NULL&&top2!=NULL)
  10. {
  11. if(top->info<top2->info)
  12. {
  13. Unione=newelem(top->info);
  14. Unione->next=Unisci(top->next,top2);
  15. return Unione;
  16. }
  17.  
  18. else
  19. {
  20. Unione=newelem(top2->info);
  21. Unione->next=Unisci(top,top2->next);
  22. return Unione;
  23. }
  24. }
  25. else if(top!=NULL && top2==NULL)
  26. {
  27. Unione=newelem(top->info);
  28. Unione->next=Unisci(top->next,top2);
  29. return Unione;
  30. }
  31. else if(top==NULL && top2!=NULL)
  32. {
  33. Unione=newelem(top2->info);
  34. Unione->next=Unisci(top,top2->next);
  35. return Unione;
  36. }
  37. return Unione;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement