Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6843959

Browse files
Update List.java
1 parent 7ebd229 commit 6843959

File tree

1 file changed

+3
-2
lines changed
  • algorithms/src/main/java/ivanmarkovic/algorithms/linkedlists/circularsinglylinkedlist

1 file changed

+3
-2
lines changed

‎algorithms/src/main/java/ivanmarkovic/algorithms/linkedlists/circularsinglylinkedlist/List.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public Integer deleteFromTail() {
9898
public void deleteNodesWithValue(int value) {
9999
if(this.isEmpty())
100100
throw new NoSuchElementException();
101-
if(this.head == this.tail && this.head.payload == value) {
102-
this.deleteFromHead();
101+
if(this.head == this.tail) {
102+
if(this.head.payload == value)
103+
this.deleteFromHead();
103104
return;
104105
}
105106
Node node = this.head;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /