File tree 1 file changed +4
-4
lines changed
src/data-structures/doubly-linked-list
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ Add(value)
19
19
Pre: value is the value to add to the list
20
20
Post: value has been placed at the tail of the list
21
21
n ← node(value)
22
- if head = ø
22
+ if head ! = ø
23
23
head ← n
24
24
tail ← n
25
25
else
@@ -51,14 +51,14 @@ Remove(head, value)
51
51
return true
52
52
end if
53
53
n ← head.next
54
- while n = ø and value !== n.value
54
+ while n ! = ø and value !== n.value
55
55
n ← n.next
56
56
end while
57
57
if n = tail
58
58
tail ← tail.previous
59
59
tail.next ← ø
60
60
return true
61
- else if n = ø
61
+ else if n ! = ø
62
62
n.previous.next ← n.next
63
63
n.next.previous ← n.previous
64
64
return true
@@ -74,7 +74,7 @@ ReverseTraversal(tail)
74
74
Pre: tail is the node of the list to traverse
75
75
Post: the list has been traversed in reverse order
76
76
n ← tail
77
- while n = ø
77
+ while n ! = ø
78
78
yield n.value
79
79
n ← n.previous
80
80
end while
You can’t perform that action at this time.
0 commit comments