-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqueue.cpp
More file actions
29 lines (28 loc) · 874 Bytes
/
queue.cpp
File metadata and controls
29 lines (28 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "Queue.h"
using namespace std;
int main()
{
Queue<int> intQueue;
cout << "intQueue.isEmpty() = " << intQueue.isEmpty() << endl;
cout << "intQueue.size() = " << intQueue.size() << endl;
for(int i = 0;i < 50; ++i)
{
intQueue.push(i);
}
cout << "intQueue.size() = " << intQueue.size() << endl;
for(int i = 0;i < 5; ++i)
{
cout << "intQueue.pop() = " << intQueue.pop() << endl;
}
cout << "intQueue.size() = " << intQueue.size() << endl;
double array[] = {-123.45, 6.7, +8.9, -0.123, 1e4};
int length = sizeof(array)/sizeof(double);
Queue<double> doubleQueue(array, length);
while (!doubleQueue.isEmpty())
{
cout << "doubleQueue.size() = " << doubleQueue.size() << endl;
cout << "doubleQueue.pop() = " << doubleQueue.pop() << endl;
}
return 0;
}