Hello I have a double linked list set up, and i have a search working for it and all that stuff, i just want to delete from it too.
For my search i have:
public void firstNameSearch(String name)
{
Node u = header;
while (u != null && u.list() != name )
{
System.out.println("Searching List...");
u = u.getNext();
}
if (u.list() == name)
{
// what do I need to put here to delete it
}
}
I have looked through over post on stack overflow, but the ones i found were in C, so weren't a great help, I understand the concept on how to make it delete the node, just can't get it functional.
Thank you in advance.
LinkedList.unlink(Node)u.list() == nameandu.list() != namealmost certainly don't do what you want. UseString.equals()instead.