java - Singly Linked List Delete Value -


i making singly linked list need put delete method getting error help?

public void remove(int index) {     getnode(index - 1).next = getnode(index + 1); } 

many possible errors can happen here. one, definitively put more verification before making changes if

  • are on first element (then header 2nd element);
  • are on last element (then getnode(index+1) returning correctly null or throwing exception)?

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -