queue_using_two_stacks.cpp File Reference
`#include <cassert>`
`#include <iostream>`
`#include <stack>`
Include dependency graph for queue_using_two_stacks.cpp:

## Functions

void | queue_test ()
int | main ()

## Detailed Description

Author
  shoniavika

Implementation of a Queue using two Stacks.

## Function Documentation

## main()

int main | ( | void |  | ) |

Main function, calls testing function

{
queue_test();
return 0;
}
queue_test
void queue_test()
Definition: queue_using_two_stacks.cpp:101
Here is the call graph for this function:

## queue_test()

void queue_test | ( |  | ) |

Testing function

{
MyQueue<int> que;
std::cout << "Test #1\n";
que.push(2);
que.push(5);
que.push(0);
assert(que.peek() == 2);
assert(que.pop() == 2);
assert(que.peek() == 5);
assert(que.pop() == 5);
assert(que.peek() == 0);
assert(que.pop() == 0);
assert(que.empty() == true);
std::cout << "PASSED\n";
std::cout << "Test #2\n";
que.push(-1);
assert(que.empty() == false);
assert(que.peek() == -1);
assert(que.pop() == -1);
std::cout << "PASSED\n";
MyQueue<double> que2;
std::cout << "Test #3\n";
que2.push(2.31223);
que2.push(3.1415926);
que2.push(2.92);
assert(que2.peek() == 2.31223);
assert(que2.pop() == 2.31223);
assert(que2.peek() == 3.1415926);
assert(que2.pop() == 3.1415926);
assert(que2.peek() == 2.92);
assert(que2.pop() == 2.92);
std::cout << "PASSED\n";
}
std::cout