Hey, long time no see?
Jokes aside, I need to implement a delete method now. It is boolean as well but it uses a diffrent parameter. I've tested the code, teh insert method works fine, but the delete doenst.After I try to delete a Person the size stays the same.
public boolean delete(String name) { Node p = head; if( p == null) { size--; return true; }else { Node temp = p; int comparison; while(temp.next != null) { comparison = temp.person.name.compareTo(name); if(comparison == 0) { temp.next = temp.next.next; size--; return true; } else { temp = temp.next; } } }return false; }