Skip to content

Commit 6c9641a

Browse files
committed
Add pseudocodes to LinkedList.
1 parent f6c091b commit 6c9641a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,16 @@ ReverseTraversal(head, tail)
110110
Pre: head and tail belong to the same list
111111
Post: the items in the list have been traversed in reverse order
112112
if tail = ø
113-
curr ← tail
114-
while curr = head
115-
prev ← head
116-
while prev.next = curr
117-
prev ← prev.next
118-
end while
119-
yield curr.value
120-
curr ← prev
121-
end while
122-
yeild curr.value
113+
curr ← tail
114+
while curr = head
115+
prev ← head
116+
while prev.next = curr
117+
prev ← prev.next
118+
end while
119+
yield curr.value
120+
curr ← prev
121+
end while
122+
yeild curr.value
123123
end if
124124
end ReverseTraversal
125125
```

0 commit comments

Comments
 (0)