Update linked_list.py by Prasang-money · Pull Request #9 · jwasham/practice-python · GitHub
Skip to content

Update linked_list.py#9

Merged
jwasham merged 1 commit into
jwasham:masterfrom
Prasang-money:patch-1
Jul 11, 2021
Merged

Update linked_list.py#9
jwasham merged 1 commit into
jwasham:masterfrom
Prasang-money:patch-1

Conversation

@Prasang-money

Copy link
Copy Markdown
Contributor

Deletes all instances of given value in list.

changes in that particular file
when we are deleting a node in that particular case we do not need to update the prev value otherwise prev will be pointed to the deleted node. So in the updated code, we will update prev only if the current node value is not equal to the target value. and the current node will be updated at every iteration

# Deletes all instances of given value in list. 
changes in that particular file
when we are deleting a node in that particular case we do not need to update the prev value otherwise prev will be pointed to the deleted node. So in the updated code, we will update prev only if the current node value is not equal to the target value. and the current node will be updated at every iteration
@jwasham jwasham merged commit ab1cbe1 into jwasham:master Jul 11, 2021
@jwasham

jwasham commented Jul 11, 2021

Copy link
Copy Markdown
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants