Guest User

Untitled

a guest
Oct 20th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. typedef struct node{
  2. int katsayi;
  3. int us;
  4. struct node *next;
  5. } Polinomlar;
  6.  
  7. void degistir(Polinomlar *a, Polinomlar *b) {
  8. int temp = a->us;
  9. a->us = b->us;
  10. b->us = temp;
  11.  
  12. int temp2 = a->katsayi;
  13. a->katsayi = b->katsayi;
  14. b->katsayi = temp2;
  15. }
  16.  
  17. void sirala(Polinomlar *p3)
  18. {
  19. int degisim, i;
  20. node *iterbub;
  21.  
  22. if (p3 == NULL)
  23. return;
  24. do
  25. {
  26. degisim = 0;
  27. iterbub = p3;
  28.  
  29. while (iterbub->next != NULL)
  30. {
  31. if (iterbub->us > iterbub->next->us)
  32. {
  33. degistir(iterbub, iterbub->next);
  34. degisim = 1;
  35. }
  36. iterbub = iterbub->next;
  37. }
  38. }while (degisim);
  39. }
Add Comment
Please, Sign In to add comment