Skip to content

Commit 194f213

Browse files
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy