Update linked-list.md

pull/1307/head
srilekha279 2024-06-27 22:06:20 +05:30 zatwierdzone przez GitHub
rodzic 53de9d4124
commit 20d36f661b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -167,10 +167,10 @@ check the list is empty otherwise shift the head to next node.
temp = self.head
while(temp):
nextNode = temp.next #Store the next node
temp.next = prev #Reverse the pointer of current node
prev = temp #Move `prev` one step forward
temp = nextNode #Move `temp` one step forward.
self.head = prev #Update the head pointer to last node
temp.next = prev # Reverse the pointer of current node
prev = temp # Move prev pointer one step forward
temp = nextNode # Move temp pointer one step forward.
self.head = prev # Update the head pointer to last node
```
### Search in a linked list