Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Node* deleteValues(Node* head, int value)
- {
- Node* current = head;
- while ((*current).value == value && current != NULL)
- {
- head = (*current).next;
- current = (*current).next;
- }
- if (current == NULL)
- {
- return head;
- }
- while ((*current).next != NULL)
- {
- if ((*(*current).next).value == value)
- {
- (*current).next = (*(*current).next).next;
- }
- else
- {
- current = (*current).next;
- }
- }
- return head;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement