-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlap.cpp
More file actions
46 lines (30 loc) · 751 Bytes
/
lap.cpp
File metadata and controls
46 lines (30 loc) · 751 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// lap.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "QueueAsArray.h"
using namespace std;
int main()
{
QueueAsArray<int> queue;
int x, y;
//
//
queue.initializeQueue();
x = 4;
y = 5;
queue.addQueue(x); // 4
queue.addQueue(y); // 4 5
queue.deQueue(x); // 5
queue.addQueue(x + 5); // 5 9
queue.addQueue(16); // 5 9 16
queue.addQueue(x); // 5 9 16 4
queue.addQueue(y - 3); // 5 9 16 4 2
std::cout << "Queue Elements: ";
while (!queue.isEmptyQueue())
{
queue.deQueue(y);
std::cout << " " << y;
}
cout << endl;
return 0;
}