Browse Source

contains-Methode implementiert

vollständige_und_weitere_testate
hertero 3 years ago
committed by chris
parent
commit
768e5f67ba
  1. 9
      SimpleLinkedList/src/solution/SimpleLinkedList.java

9
SimpleLinkedList/src/solution/SimpleLinkedList.java

@ -65,15 +65,14 @@ public class SimpleLinkedList<E> extends AbstractSimpleList<E> {
if (o == null) {
return false;
}
Node<E> aktuellerKnoten = ersteKnoten;
while(aktuellerKnoten != null) {
aktuellerKnoten = aktuellerKnoten.getSuccessor();
Node<E> currentNode = firstNode;
while (currentNode != null) {
currentNode = currentNode.getSuccessor();
}
if(o.equals(aktuellerKnoten)) {
if (o.equals(currentNode)) {
return true;
}
return false;
}
@Override

Loading…
Cancel
Save