• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
September 13, 2023 |310 Views

SDE Sheet - n’th node from end of Linked list

  Share  1 Like
Description
Discussion

This video is part of the Linked List section in the GFG SDE Sheet.

In this video, we are given a linked list consisting of L nodes and given a number N. The task is to find the Nth node from the end of the linked list.

Example :

Input:
N = 2
LinkedList: 1->2->3->4->5->6->7->8->9

Output: 8

Explanation: In the first example, there are 9 nodes in linked list and we need to find 2nd node from end. 2nd node from end is 8.  


Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/nth-node-from-the-end-of-a-Linked-list/
Problem: https://practice.geeksforgeeks.org/problems/nth-node-from-end-of-linked-list/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/