Implement the delete method for link list.