Question: Given a linked list, find the kth element from the end of the list.
Answer: Take two pointers temp1 and temp2, assign both of them to head. Move one pointer (say temp1) K times so that the distance between temp1 and temp2 is k.
Now start moving both the pointers until temp1 reach the end of the list. Now temp2 points to the kth element from the end of the list.
For source code see GetKthElementFromEnd method in the page.