void prob(node *&head)
{
node *current = head;
node *prev = head;
node *n = head;
while (current->next != NULL)
{
if (current->next->data % 2 != 0)
{
prev = current;
current = current->next;
n = current->next;
prev->next = n;
current->next = head;
head = current;
current = prev;
}
else
current = current->next;
}
}
Sir this function is doing what is stated in the problem then why some test cases are coming wrong.