You are viewing a single comment's thread. Return to all comments →
if (position == 0){ if (head.next == null){ return null; } else { return head.next; } } else { SinglyLinkedListNode current = head; for (int i = 0;i < position - 1; i++){ current = current.next; } current.next = current.next.next; return head; } }
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 →