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 194f213

Browse files
surajhell88trekhleb
andauthored
Adding inequality conditions (trekhleb#489)
A quick fix to add inequality conditions wherever needed. Co-authored-by: Oleksii Trekhleb <trehleb@gmail.com>
1 parent 63f5a27 commit 194f213

File tree

1 file changed

+3
-3
lines changed
  • src/data-structures/doubly-linked-list

1 file changed

+3
-3
lines changed

‎src/data-structures/doubly-linked-list/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ Remove(head, value)
6666
return true
6767
end if
6868
n ← head.next
69-
while n = ø and value !== n.value
69+
while n != ø and value !== n.value
7070
n ← n.next
7171
end while
7272
if n = tail
7373
tail ← tail.previous
7474
tail.next ← ø
7575
return true
76-
else if n = ø
76+
else if n != ø
7777
n.previous.next ← n.next
7878
n.next.previous ← n.previous
7979
return true
@@ -89,7 +89,7 @@ ReverseTraversal(tail)
8989
Pre: tail is the node of the list to traverse
9090
Post: the list has been traversed in reverse order
9191
n ← tail
92-
while n = ø
92+
while n != ø
9393
yield n.value
9494
n ← n.previous
9595
end while

0 commit comments

Comments
(0)

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