logo

Crowdly

Baikite įgyvendinti ciklinio vienakrypčio tiesinio sąrašo metodą  deleteLast()...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Baikite įgyvendinti ciklinio vienakrypčio tiesinio sąrašo metodą deleteLast(), kuris atsakingas už paskutinio elemento ištrynimą.

-----------------------------------------------------------------------------------------------------------------------

Kodas:

struct node

{

    int data;

    node* next;

};

class CircularLinkedList

{

private:

    node* tail; 

public:

    CircularLinkedList() 

    {

        tail = nullptr;

    }

    void deleteLast()

    {

        if ((tail == nullptr)

        {

        std::cout << "Sarasas tuscias, nera ka trinti. \n";

        return;

        }

        //  BAIGTI PILDYTI KODĄ

       count--;

    }

More questions like this

Want instant access to all verified answers on moodle.vilniustech.lt?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!