You are viewing a single comment's thread. Return to all comments →
public static Node insert(Node head,int data) { Node newNode = new Node(data); if (head == null) { return newNode; } Node current = head; while (current.next != null) { current = current.next; } current.next = newNode; return head; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 15: Linked List
You are viewing a single comment's thread. Return to all comments →