Skip to content

Commit 20d36f6

Browse files
authored
Update linked-list.md
1 parent 53de9d4 commit 20d36f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

contrib/ds-algorithms/linked-list.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ check the list is empty otherwise shift the head to next node.
167167
temp = self.head
168168
while(temp):
169169
nextNode = temp.next #Store the next node
170-
temp.next = prev #Reverse the pointer of current node
171-
prev = temp #Move `prev` one step forward
172-
temp = nextNode #Move `temp` one step forward.
173-
self.head = prev #Update the head pointer to last node
170+
temp.next = prev # Reverse the pointer of current node
171+
prev = temp # Move prev pointer one step forward
172+
temp = nextNode # Move temp pointer one step forward.
173+
self.head = prev # Update the head pointer to last node
174174
```
175175

176176
### Search in a linked list

0 commit comments

Comments
 (0)