Course Solutions Uncategorized (Solved) : C Alter Code Deletes Occurances Given Element Form Template Void Unorderedlinkedlist Delet Q31820066 . . . .

(Solved) : C Alter Code Deletes Occurances Given Element Form Template Void Unorderedlinkedlist Delet Q31820066 . . . .

 

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 =

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post