You are viewing a single comment's thread. Return to all comments →
public static SinglyLinkedListNode? deleteNode(SinglyLinkedListNode? llist, int position) { if(llist == null) { return null; }
if(position == 0) { return llist.next; } int currentPosition =0; SinglyLinkedListNode? current = llist; while( current !=null && current.next != null && currentPosition < position-1) { current = current.next; currentPosition++; } if (current == null || current.next == null) { return llist; } current.next = current.next.next; return llist; }
it show: error CS0103: The name 'deleteNode' does not exist in the current context....
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 →
public static SinglyLinkedListNode? deleteNode(SinglyLinkedListNode? llist, int position) { if(llist == null) { return null; }
it show: error CS0103: The name 'deleteNode' does not exist in the current context....