I am really sorry to dissapoint you akshat but Question clearly says that it is a singly linked list.So, it would be difficult for us to store n-1th node's pointer with your method .
On Wed, Aug 31, 2011 at 12:37 PM, Akshat Sapra <[email protected]>wrote: > I have provided you the solution and I think you are experienced enough to > make the solution yourself but I can provide you a Pseudocode. > > //Solution for Doubly linked list > > Inverse(node *start, node *end) { > print(end); > } > > print(node *start,node *end) { > do { > print(end->data); > end = end->next; > } > while ( end != start ) > } > > call the functions two times > inverse(0th node,n-1th node); > inverse(nth node, list.size()th node); > > -- > > > Akshat Sapra > Under Graduation(B.Tech) > IIIT-Allahabad(Amethi Campus) > -------------------------------------- > [email protected] > [email protected] > [email protected] > [email protected] > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Mohit kumar lal rit2009014 IIIT ALLAHABAD contact@9454681805 [email protected] [email protected] [email protected] http://profile.iiita.ac.in/rit2009014 -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
