Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 194f213

Browse files
surajhell88trekhleb
andauthoredJul 26, 2020
Adding inequality conditions (trekhleb#489)
A quick fix to add inequality conditions wherever needed. Co-authored-by: Oleksii Trekhleb <[email protected]>
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

+3-3
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)
Please sign in to comment.