Question: Data Structures and Algorithms(Python) Part B, A2B (10 marks) Write a Python program, with the given Python files. o Enhancing our Queue: Enhance and implement

Data Structures and Algorithms(Python)

Part B, A2B (10 marks) Write a Python program, with the given Python files. o Enhancing our Queue: Enhance and implement a Queue ADT (with Linked-List approach), by modifying our given Python file A2B.py (based on the one in our lecture notes, QueueLL.py) o Extra Operations (methods of the class) to be implemented by Students: At least one line of simple comment for each extra operation required Operation (QueueLL) Description isEmptyQ():bool Check if the queue is empty or not sizeQ():int Get the size of the queue (total number of elements) searchQ(elt):bool Check if an input searching element elt is in the queue. dispDupEltQ(): Display duplicated items only once, as the sample display output. * You may use extra queues in this method to finish this task Given Materials: o Python file A2B.py, to be modified and completed by student. Also modify top comments for your STUDENT INFO. (DO NOT modify this given portions, including given methods if any) o Python file A2BT.py for basic running and testing. DO NOT modify this given test file, except the STUDENT INFO part. 2 / 4 File A2B.py, to be modified and completed by student.

Data Structures and Algorithms(Python) Part B, A2B (10 marks) Write a Python

program, with the given Python files. o Enhancing our Queue: Enhance and

2. Part B, A2B (10 marks) Write a Python program, with the given Python files. O Enhancing our Queue: Enhance and implement a Queue ADT (with Linked-List approach), by modifying our given Python file A2B.py (based on the one in our lecture notes, QueueLL.py) Extra Operations (methods of the class) to be implemented by Students: At least one line of simple comment for each extra operation required Operation (QueueLL) Description isEmptyQ(): bool Check if the queue is empty or not sizeQ():int Get the size of the queue (total number of elements) searchQ(elt): bool Check if an input searching element elt is in the queue. dispDupEltQ(): Display duplicated items only once, as the sample display output. * You may use extra queues in this method to finish this task O Given Materials: Python file A2B.py, to be modified and completed by student. Also modify top comments for your STUDENT INFO. (DO NOT modify this given portions, including given methods if any) Python file A2BT.py for basic running and testing. DO NOT modify this given test file, except the STUDENT INFO part. O File A2B.py, to be modified and completed by student. # A2B.py, for IDSA Assign 2 class Queuelli # defining a class of Queue, with Linked-List *** STUDNET'S WORK *** # simple comment HERE def is Empty(self). pass # TO BE DONE # MORE TO BE DONE File A2BT.PY for basic running and testing # A2BT.py, for basic running and testing. DO NOT modify this given test file, except the STUDENT INFO part. # Main Testing Program from A2B import Queuell def main() print(" === A2B, Enhanced Queuell progran, by === ") myQ = QueueLL) print(" --- 1. New Queuell created ---") myQ.display() print(" isEmpty() isi (myQ.isEmptyO}") myQ.enqueue ('AA'); myQ.enqueue("BB"); myQ.enqueue (CC) myQ.enqueue ('AA'); myQ.enqueue("BB"); myQ.enqueue (AA) print(" --- 2. ENQueuedi AA BB, CC, AA, BB, AA ---") myQ.displayo print(f" isEmptyQ() isi {myQ.isEmptyQ0}") print(" sizeQ() isi print(" searchQC "CC) si (myq. Search (CC)}") print(" searchQ( "00") isi {myQ.searchQ(0)") print(" --- 3. dispDupelto my.dispDupElto() print(" === Program ends === ") main() Sample console display output of executing the main testing program A2BT.DY === A2B, Enhanced Queuell program, by === --- 1. New Queuell created --- >>> Queue Display, (Front/Left to Rear/Right) ... AN EMPTY QUEUE isEmpty() is True --- 2. ENQueueda AA, BB, CC, AA, BB, AA >>> Queue Display, (Front/Left to Rear/Right) ... FRONT , REAR isEmpty() isi False sizeQ() isi 6 searchQ("CC") is True searchQ("DD') is False --- 3. dispDupEltQ() --- DUPLICATED ITEMS in QUEUE arei AA BB === Program ends ===

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!