Сортировать связанный список C
void BubbledSort_linked_list(struct Node **head)
{
Node * curr = *head;
Node * next;
int temp;
while (curr && curr->next)
{
Node * next = curr->next;
while (next)
{
if (curr->data > next->data)
{
std::swap(next->data, curr->data);
}
next = next->next;
}
curr = curr->next;
}
}
Spotless Shark