In this article, we will discuss an algorithm to find the nth node from the end of a singly linked list. First, let’s discuss what is singly liked list. Singly Linked List It is a linked list, we can traverse only forward direction. We can’t move to backwards. That means, in a singly linked list, each node in the list has the content and a pointer to the next node in the list. It does not store any pointer to the previous node. To store a single linked list, only the pointer to the first node in that list must

The post Find the nth node from the end of a singly linked list ? appeared first on Dinesh on Java.

Source link

Find the nth node from the end of a singly linked list ?

Leave a Reply

Your email address will not be published. Required fields are marked *