✅ 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Ą!
}
};
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!