pratik-choudhari / AlgoCode

Welcome everyone!🌟 Here you can solve problems, build scrappers and much more💻
https://github.com/pratik-choudhari/AlgoCode
MIT License
131 stars 166 forks source link

To find Nth node from last in the linked list issue #282

Closed dhruvin5 closed 4 years ago

dhruvin5 commented 4 years ago

Description

Issue number #271 This is the code to find the Nth node from the last in the linked list. I have used c++ language. The linked list is first created using insert operation and then passed on to the function along with the value of n. Then at first counts the number of nodes in the linked list. Then it finds the nth node from the last. If this node exists,then it returns the node and prints the data in the node. If this node does not exist then it returns null and prints that NODE DOES NOT EXIST.