Program for n’th node from the end of a Linked List

Given a Linked List and a number n, write a function that returns the value at the n’th node from the end of the Linked List.

code:

def get_from_last(self,index):
temp = self.head
node = self.get_length() - index+1
temp = self.get_n(node)
return temp

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sairam Penjarla

Sairam Penjarla

Looking for my next opportunity to make change in a BIG way