Concept Flow - Delete Node by Value
Start at head
Is head null?
Yes→Stop: List empty
No
Is head value == target?
Yes→Delete head, update head
No
Set current = head
While current.next != null
Is current.next.value == target?
Yes→Delete current.next
No
Move current to current.next
Back to While
Target not found or deleted
End
↩Back to While
Start from the head node, check if it matches the target value to delete. If yes, remove it by updating head. Otherwise, traverse the list to find the node before the target and remove the target node by adjusting pointers.
