nth node from end of a linked list

Write a C program to return the nth node from the end of a linked list.


  1. take two pointers
    first move pointer1 by a distance=n
    now move both the pointers till pointer1 reaches end
    you would see that pointer 2 points to nth node from last....

  2. @ankit absolutely correct approach...:)


Post a Comment

Popular posts from this blog