Question: hi anyone help me with this question click the picture for full info. PRACTICAL 3 - STACKS & QUEUES AIMS To create general-purpose stack and
hi anyone help me with this question

click the picture for full info.
PRACTICAL 3 - STACKS & QUEUES AIMS To create general-purpose stack and queue classes Apply these classes to imitate and understand the call stack To implement a program to convert infix equations to postfix and evaluate the postfix equation. BEFORE THE PRACTICAL: Read this practical sheet fully before starting. ACTIVITY 1: UML DIAGRAMS Before you start coding, draw the UML diagrams for DSAStack, DSAQueue, DSAShufflingQueue, DSACircularQueue and their test harnesses. Get feedback on the diagrams before you start coding. ACTIVITY 2: IMPLEMENTATION OF STACK AND QUEUE Although Java and Python provide Stack and Queue classes to implement these abstract data types, we will be implementing our own versions to get a hands-on understanding of how they work. Create two classes: DSAStack and DSAQueue and implement them using arrays as the data structure. Use your UML diagrams and the pseudocode from the lecture notes to guide you in their implementation. Use an Object[ ] / dtype=object array rather than the double of the lecture notes. Object is a special class in Java/Python in that all classes inherit from Object (i.e., all classes are a specialisation of Object). Thus making the array type Object[] means that you don't limit what kind of data you can put into the ADT - we are creating general-purpose ADT classes here. Data Structures and Algorithms Use an int member field to track the count of elements in the stack. Thus a value of O implies that the stack is empty. Note that using an array to store the elements in the DSAQueue is more problematic than it is for DSAStack because DSAQueue's front and rear both 'move'. That is, when enqueuing a new element to the rear the current tail index increases by one, and when dequeuing the element at the front the current head index also changes. The first solution we will use is to shift all the elements up by one after dequeuing the first value, causing a shuffling effect. This shuffling queu is simple but inefficient. Page 1 of 4 Last Updated: 10/03/20 Java students: Do not implement copy constructors for DSAStack and DSAQueue - it is usually both unnecessary and inappropriate to make copies of lists. Make sure you write test harnesses and test both classes fully. ACTIVITY 3: CIRCULAR QUEUE Create a second implementation of the DSAQueue to use a circular queue. The circular queue 'chases the front and even cycles around the array when the front passes the end of the array. Just be sure to track the count of elements in the queue: although you could calculate the count from the start' and 'end' indexes, it makes the queue much more complicated to get working right. Set this and the shuffling queue up as sub-classes of the DSAQueue parent class. See the lecture slides for the simplified UML. Modify your test harness to test out both versions of the queues. ACTIVITY 4: CALL STACK We are now going to write some code to imitate the call stack. In your code, when you enter a method, its name and arguments are put onto the stack as a string. As you exit the method, those values are popped back off the stack. You can display the stack at any time by calling its display method. This is similar to a question on recent mid-semester tests. Provide test cases with nested method calls and with a recursive call
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
