logo

Crowdly

Baikite įgyvendinti vienakrypčio tiesinio sąrašo  metodą addNodeEnd() , kuris ...

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

Baikite įgyvendinti vienakrypčio tiesinio sąrašo metodą addNodeEnd(), kuris atsakingas už naujo elemento pridėjimą į sąrašo pabaigą.

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

Kodas:

struct node

{

    int data;

    node* next;

};

class linkedList

{

private:

    node* head;

    node* tail;

public:

    linkedList()  

    {

        head = nullptr;

        tail = nullptr;

    }

    void addNodeEnd(int value)

    {

        node* temp = new node; 

        temp->data = value;

        temp->next = nullptr;

        //  BAIGTI PILDYTI KODĄ

    }

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!