Algorithm to Insert a Node at the End of the Linked list