You are viewing a single comment's thread. Return to all comments →
Node Insert(Node head,int data) { Node tmp = new Node(); tmp.data = data; tmp.next = null;
if(head == null) { head = tmp; return head; } Node current = head; while(current.next != null) { current = current.next; } current.next = tmp; 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 →
Node Insert(Node head,int data) { Node tmp = new Node(); tmp.data = data; tmp.next = null;
}