You are viewing a single comment's thread. Return to all comments →
Java implementation :
if (head == null){ head = new Node(); head.data = data; } else { Node node = head; while (node.next != null){ node = node.next; } node.next = new Node(); node.next.data = data; } return head;
Seems like cookies are disabled on this browser, please enable them to open this website
Insert a Node at the Tail of a Linked List
You are viewing a single comment's thread. Return to all comments →
Java implementation :