You are on page 1of 5

Lab 03- Queues Spring 2022

Data Structures & Applications


Fall 2023
Lab 03 –Queues

Instructor: Paras Memon

Instructions:

• At the end of this Lab, you will have to submit all files on classroom.
• File format should be .zip/.rar file containing required .java files and additional if required.
• File Name should be your CMSID_Name_Lab03.zip.
• Create a project named lab01_dsa and perform following tasks.

Task 01: Reverse Linked List

Given the head of a singly linked list, reverse the list, and return the reversed list.

Data Structures & Applications by Paras Memon Sukkur IBA University


Queue
Note: Keep this code with you till the course ends.

Task 02: (Queue using array)

Understand provided code and implement all required methods in Queue.


Queue Code is given below:
Implement all the methods, run the code. Your output should be like as
follows:

Output
Task 03:(Queue using Linked list)

Understand provided code and implement all required methods in Queue.


Queue Code is given below:
Lab 02- Stacks, Queues Spring 2020

54.
55. q.dequeue();
56. q.dequeue();
57. q.dequeue();
58. q.dequeue();
59.
60. if (q.isEmpty()) {
61. System.out.print("Queue is empty");
62. } else {
63. System.out.print("Queue is not empty");
64. }
65. }
66. }
After implementing all the methods, run the code. Your output should be
like as follows:

Output

Data Structures & Applications by Saif Hassan Sukkur IBA University

You might also like