This document contains an assignment on data structures for a lab course. It includes 4 questions asking students to write programs to: 1) implement a queue using an array and perform enqueue and dequeue operations; 2) find the time complexity of each queue operation; 3) implement a circular queue and perform enqueue and dequeue; and 4) implement a queue using a stack and perform operations, printing the queue after each. Students are asked to take user input and print updated queues after each operation.
This document contains an assignment on data structures for a lab course. It includes 4 questions asking students to write programs to: 1) implement a queue using an array and perform enqueue and dequeue operations; 2) find the time complexity of each queue operation; 3) implement a circular queue and perform enqueue and dequeue; and 4) implement a queue using a stack and perform operations, printing the queue after each. Students are asked to take user input and print updated queues after each operation.
Shri G S Institute of Technology and Science Indore
Department of Information Technology (MCA)
Subject: Data Structure (Lab)
Assignment-2 Q.1 Write a program to initialize the queue using array (Ex.- queue[size]) and it should be performed following operations: 1) Enqueue operation on the queue until queue not full or user entered no 2) Dequeue operation on the queue 3) After performing each operation updated queue should be printed automatically. Q.2 Find the complexity of each operation Q.3 Implement the circular queue and perform both (Enqueue and Dequeue) operation. The program should be taken the choice of the user to continue. Before the asking for a choice complete updated queue should be printed on the screen. Q.4 Implement a queue using a stack and perform both (Enqueue and Dequeue) operations. After the performing operation, each time updated queue should be printed on the screen. Also, find the complexity of this program.