From 80359f466f12f57683874251a769b72eebfac90a Mon Sep 17 00:00:00 2001 From: AntaraRoy123456 <116708061+AntaraRoy123456@users.noreply.github.com> Date: Thu, 27 Oct 2022 17:25:59 +0530 Subject: [PATCH] DSA QUEUE CODE --- DSA QUEUE CODE | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 DSA QUEUE CODE 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; +}