You are on page 1of 2

Bangladesh University of Business and Technology

Lab Report: 10

Dept. name: Computer Science and Engineering

Course name: Data Structure Lab

Course code: CSE 232

Submitted By: Rafsan Samin


22234103208

Submitted To: Md. Mahbub-Or-Rashid


Assistant professor,
Dept. of Computer Science and Engineering

Submission Date: 11-12-2023


Queue Implementation

#include <iostream>
#include <queue>

int main() {
std::queue<int> myQueue;

myQueue.push(1);
myQueue.push(2);
myQueue.push(3);

std::cout << "Front of the queue: " << myQueue.front() << std::endl;
std::cout << "Queue size: " << myQueue.size() << std::endl;

std::cout << "Dequeuing elements: ";


while (!myQueue.empty()) {
std::cout << myQueue.front() << " ";
myQueue.pop();
}
std::cout << std::endl;

return 0;
}

Output:
Front of the queue: 1
Queue size: 3
Dequeuing elements: 1 2 3

You might also like