Recent Posts
None | 2 sec ago
None | 7 sec ago
Groovy | 13 sec ago
PHP | 15 sec ago
None | 28 sec ago
None | 1 min ago
None | 1 min ago
PHP | 1 min ago
XML | 2 min ago
None | 2 min ago
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By joey on the 9th of Feb 2010 11:30:29 PM
Download |
Raw |
Embed |
Report
public void remove(DataElement datum)
{
boolean found = false;
Node tempElement = null;
Node prevElement = null;
while (i.hasNext() || !found)
{
tempElement.data = i.getNext();
if (tempElement.data.equals(datum))
{ // found it, remove
if (prevElement != null)
{
prevElement.link = tempElement.link;
}
else
{ // this was first element
first = null;
}
if (tempElement == last)
{
last = null;
}
found = true;
}
else
{
prevElement = tempElement;
}
}
}
Submit a correction or amendment below.
Make A New Post