You are viewing a single comment's thread. Return to all comments →
JAVA Solution public static SinglyLinkedListNode deleteNode(SinglyLinkedListNode llist, int position) { // Write your code here
int i=1; SinglyLinkedListNode temp = llist; if(position == 0) { llist = llist.next; return llist; } while(temp.next.next != null && i < position){ temp = temp.next; i++; } temp.next = temp.next.next; return llist; }
Seems like cookies are disabled on this browser, please enable them to open this website
Delete a Node
You are viewing a single comment's thread. Return to all comments →
JAVA Solution public static SinglyLinkedListNode deleteNode(SinglyLinkedListNode llist, int position) { // Write your code here