Advertisement
Alx09

Untitled

Dec 18th, 2020
1,092
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. nod *function(nod * lista) {
  2.     nod *q1, *q2, *q3= NULL, *q4= NULL;
  3.     int m = lista->valoare;
  4.     for (q1 = q2 = lista; q1 != NULL; q2 = q1, q1 = q1->urm) {
  5.         if (m <= q1->valoare)
  6.         {m = q1->valoare; q3 = q2; q4 = q1;}
  7.     }
  8.         if (q3 != q4) {
  9.             q3->urm = q4->urm;
  10.             q4->urm = lista;
  11.     }
  12.    
  13.     return q4;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement