// From the software distribution accompanying the textbook // "A Practical Introduction to Data Structures and Algorithm Analysis, // Third Edition" by Clifford A. Shaffer, Prentice Hall, 2007. // Source code Copyright (C) 2006 by Clifford A. Shaffer. // Calls for testing queue implementations template void QueueTest(Queue& Que) { El temp; // Test a bunch of queue operations Que.enqueue(10); Que.enqueue(20); Que.enqueue(15); cout << "Length is " << Que.length() << endl; if (Que.frontValue(temp)) cout << "Front is " << temp << endl; else cout << "Nothing in queue\n"; while(Que.dequeue(temp)) cout << temp << " "; cout << endl; cout << "Length is " << Que.length() << endl; if (Que.frontValue(temp)) cout << "Front is " << temp << endl; else cout << "Nothing in queue\n"; Que.clear(); cout << "Length is " << Que.length() << endl; cout << "That is all.\n\n"; }