forked from mandliya/algorithms_and_data_structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueueDemo.cpp
More file actions
27 lines (24 loc) · 666 Bytes
/
queueDemo.cpp
File metadata and controls
27 lines (24 loc) · 666 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
#include <iostream>
#include "../include/queue.h"
#include "../include/generic.h"
int main()
{
const int QUEUE_SIZE = 10;
algo::Queue<int> Q(QUEUE_SIZE);
std::cout << "Pushing following values to queue:\n";
for ( int i = 0; i < QUEUE_SIZE; ++i )
{
int rand_value = algo::random_range( 5, 50 );
std::cout << rand_value << " ";
Q.push(rand_value);
}
std::cout << std::endl;
std::cout << "Size of Queue is :" << Q.count() << std::endl;
std::cout << "\nPopping queue values :\n";
while ( !Q.empty() ) {
std::cout << Q.front() << " ";
Q.pop();
}
std::cout << std::endl;
return 0;
}