You are viewing a single comment's thread. Return to all comments →
A Python solution:
def insertNodeAtTail(head, data): new_node = SinglyLinkedListNode(data) if head is not None: current = head while current.next: current = current.next current.next = new_node return head return new_node
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Insert a Node at the Tail of a Linked List
You are viewing a single comment's thread. Return to all comments →
A Python solution: