Skip to main content

Program to Reverse a single linked list

 Program to Reverse a single linked list

Node *Reverse (Node *p)
{
  Node *pr = NULL;
  while (p != NULL)
  {
  Node *tmp = p->next;
  p->next = pr;
  pr = p;
  p = tmp;
  }
  return pr;
}

Comments

Popular posts from this blog

CAN INTERVIEW QUESTIONS

Qualifiers and Modifier in C

RTOS Real time operating system interview questions

CAN INTERVIEW QUESTIONS 2

What is UDS protocol

Memory mapping in c

TOP IOT PLATFORMS