diff --git a/DSA QUEUE CODE b/DSA QUEUE CODE new file mode 100644 index 00000000..b972fa45 --- /dev/null +++ b/DSA QUEUE CODE @@ -0,0 +1,31 @@ +#include +#include + +using namespace std; + +int main() { + + // create a queue of string + queue animals; + + // push elements into the queue + animals.push("Cat"); + animals.push("Dog"); + + cout << "Queue: "; + + // print elements of queue + // loop until queue is empty + while(!animals.empty()) { + + // print the element + cout << animals.front() << ", "; + + // pop element from the queue + animals.pop(); + } + + cout << endl; + + return 0; +}