|
|
@ -62,18 +62,17 @@ public class SimpleLinkedList<E> extends AbstractSimpleList<E> { |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean contains(Object o) { |
|
|
|
if(o == null) { |
|
|
|
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 |
|
|
|