Answers

Question and Answer:

  Home  Linked list

⟩ Explain how to find 3rd element from end in a linked list in one pass?

This is another frequently asked linked list interview question. This question is exactly similar to finding middle element of linked list in single pass. If we apply same trick of maintaining two pointers and increment other pointer, when first has moved upto 3rd element, than when first pointer reaches to the end of linked list, second pointer will be pointing to the 3rd element from last in a linked list.

 133 views

More Questions for you: