Change
This commit is contained in:
67
LinearList/Queue/arrayQueue/main.cpp
Normal file
67
LinearList/Queue/arrayQueue/main.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
#include "arrayQueue.h"
|
||||
using namespace std;
|
||||
int main() {
|
||||
arrayQueue<int> a(10);
|
||||
cout << "If a is empty? : " << a.empty() << endl;
|
||||
a.push(1); a.push(2); a.push(3); a.push(4); a.push(5);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.pop();
|
||||
a.pop();
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(6); a.push(7); a.push(8); a.push(9); a.push(10);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(11);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(12);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(13); a.push(14); a.push(15);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(16); a.push(17); a.push(18); a.push(19); a.push(20);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(21);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
a.push(22);
|
||||
a.showArray();
|
||||
a.showQueue();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
This is the result, Perfectly match
|
||||
If a is empty? : 0
|
||||
0 1 2 3 4 5 6 7 8 9
|
||||
-1 1 2 3 4 5 -1 -1 -1 -1
|
||||
1 2 3 4 5
|
||||
0 1 2 3 4 5 6 7 8 9
|
||||
-1 1 2 3 4 5 -1 -1 -1 -1
|
||||
3 4 5
|
||||
0 1 2 3 4 5 6 7 8 9
|
||||
10 1 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10
|
||||
0 1 2 3 4 5 6 7 8 9
|
||||
10 11 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10 11
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
10 11 12 0 0 1 40 0 161 -1 10 11 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10 11 12
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
10 11 12 13 14 15 40 0 161 -1 10 11 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
10 11 12 13 14 15 16 17 18 19 20 11 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
||||
10 11 12 13 14 15 16 17 18 19 20 21 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
||||
0 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
|
||||
10 11 12 13 14 15 16 17 18 19 20 21 22 0 0 1 80 0 408 -1 10 11 12 13 14 15 16 17 18 19 20 21 2 3 4 5 6 7 8 9
|
||||
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
||||
*/
|
Reference in New Issue
Block a user