Below is an algorithm that removes nodes from a singly-linked list given an input value.