In C++, Alter code so that it deletes all occurances ofa given element.
Should be in form:
template <class Type>
void UnorderedLinkedList<Type>::deleteAll(const Type&deleteItem)
{
//Here
}
template <class Type>
void UnorderedLinkedList<Type>::deleteSmallest()
{
{
NodeType<Type> *current = 0;
NodeType<Type> *trailCurrent = 0;
NodeType<Type> *small = 0;
NodeType<Type> *trailSmall = 0;
current = this->first;
if (this->first == nullptr) //list is empty.
cout << “Can not delete from an empty list.” <<endl;
else if (current->link == nullptr) // list has only oneelement, so we delete it
{
delete current;
this->first = nullptr;
this->last = nullptr;
this->count–;
cout << “deleted the single element of listn”;
}
else {
trailCurrent = current;
current = current->link;
small = trailCurrent;
while (current != nullptr){
if (current->info >= small->info)
{
trailCurrent = current;
current = current->link;
}
else {
trailSmall = trailCurrent;
small = current;
trailCurrent =
PayPal Gateway not configured
PayPal Gateway not configured