[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Interview Questions and Answers :: Alcatel-Lucent

2. write a program to reverse the linklist.

Answer:

struct node * reverseList ( struct node *current, struct node *prev)
{
struct node *tmp = current->next;
current->next = prev;
if (tmp !=NULL)
reverseList(tmp, current);

return current;
}

Post Your Answer Here:      Public      Private

Rate This: +0 -0
Report     

Post Your Reply Here:     

Report Error

Report Error

Please Login First Click Here