Advertisement
Guest User

Untitled

a guest
May 23rd, 2020
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1.     for (node* c = head; c != NULL; c = c->y)
  2.     {
  3.         for (node* prev = head, *current = head->y, *next = head->y->y; next != NULL; prev = prev->y, current = current->y, next = next->y)
  4.         {
  5.             if (next->x < current->x)
  6.             {
  7.                 node* x = prev->y;
  8.                 prev->y = current->y;
  9.                 node* y = next->y;
  10.                 next->y = x;
  11.                 current->y = y;
  12.             }
  13.         }
  14.     }
  15. //error:Exception thrown: read access violation.
  16. prev was nullptr.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement