Skip to content

Instantly share code, notes, and snippets.

@ahinz
Created November 3, 2011 18:48
Show Gist options
  • Save ahinz/1337409 to your computer and use it in GitHub Desktop.
Save ahinz/1337409 to your computer and use it in GitHub Desktop.
public boolean removeNode(Node aNode) {
Node prevNode = this;
Node curNode = this.next;
do {
if (curNode == aNode) {
prevNode.next = curNode.next;
return true;
}
prevNode = curNode;
curNode = curNode.next;
} while (prevNode != this);
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment