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;
}
ALL ABOUT TECHNOLOGY,andthinker embedded tutorials and IOT tutorials ,interview questions
Comments