logo

Crowdly

Baikite įgyvendinti deko duomenų struktūros metodą popBack , kuris atsakingas...

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

Baikite įgyvendinti deko duomenų struktūros metodą popBack, kuris atsakingas už elemento ištrynimą iš deko pabaigos.

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

Kodas:

class DequeArray

{

private:

    int first, last;

    int deque[MAXSIZE] = { 0 };

public:

    DequeArray()  //konstruktorius 

    {

        first = -1;

        last = -1;

    }

    void popBack() {

        if (isEmpty())

        {

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

            return;

        }

       if (first == last)

       {

            first = -1;

            last = -1;

       }

            // BAIKITE 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!