Created
November 3, 2011 18:48
-
-
Save ahinz/1337409 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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