Example #1
0
int main(){
	
	Queue<int> q;
	
	q.enqueue(10);
	q.enqueue(15);
	q.enqueue(20);
	q.enqueue(25);
	
	Queue<int> copy = q;
	
	while(! copy.isEmpty()){
		cout << copy.dequeue() << endl;
	}
	
	cout << "---" << endl;
	ReverseQueue(q);
	while(! q.isEmpty()){
		cout << q.dequeue() << endl;
	}
		
								
	
	
	
	return 0;
}
int main() {
    
    Queue<int> myQ;
    
    cout << "Enter ints to queue up (-1 to end): ";
    int num;
    while ((num = GetInteger()) != Sentinal) {
        myQ.enqueue(num);
        cout << "Next? ";
    }
    
    PrintQ(myQ);
    
    cout << "Now Reverse it" << endl;
    
    ReverseQueue(myQ);
    
    PrintQ(myQ);
    
    cout << "END" << endl;
    
    return 0;
}