logo

Crowdly

Baikite įgyvendinti eilės duomenų struktūros metodą reverse () , kuris atsaki...

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

Baikite įgyvendinti eilės duomenų struktūros metodą reverse(), kuris atsakingas už eilės elementų "apsukimą", panaudojant steką.

Dėmesio! Būtina išlaikyti eilės veikimo principos,. t.y  realizuoti pasinaudojant eilės klasės metodais, o ne bėgant per masyvo indeksus.

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

Kodas:

class QueueArray

{

private:

    int first;

    int last;

    int queue[MAXSIZE] = { 0 };

public:

    QueueArray() 

    {

        first = -1;

        last = -1;

    }

    bool isEmpty(){}

    bool isFull(){}

    void enqueue(int value){}

    void dequeue() {}

    int peekFirst() {} 

    int peekLast() {}

    void reverse()

    {

        stack<int> stekas;

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