We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ebd229 commit 6843959Copy full SHA for 6843959
algorithms/src/main/java/ivanmarkovic/algorithms/linkedlists/circularsinglylinkedlist/List.java
@@ -98,8 +98,9 @@ public Integer deleteFromTail() {
98
public void deleteNodesWithValue(int value) {
99
if(this.isEmpty())
100
throw new NoSuchElementException();
101
- if(this.head == this.tail && this.head.payload == value) {
102
- this.deleteFromHead();
+ if(this.head == this.tail) {
+ if(this.head.payload == value)
103
+ this.deleteFromHead();
104
return;
105
}
106
Node node = this.head;
0 commit comments