Write a c program to reverse singly link list?  this is one of the famous interview question. There are various linked list data structure in computer science which are used to store data. the data is grouped with the address of next data and this group identity is called node in linked list. As from below figure the list is 1,2,3,4,5 and 5 is the last node of the link list.

 revlinkl

         (Each node in above is having address of its next node , for example head node in above list , is having address of node containing number 2)

Before:

Head(1)->(2)->(3)->(4)->(5)Tail

After:

Tail(1)<-(2)<-(3)<-(4)<-(5)Head

 




Related Contents to follow