Question: Given the following code: 1 2 2345 DATASTRUCTURE test = new DATASTRUCTURE(); test.add(10); test.add(30); test.add(15); 5 test.add(1); 6 7 8 9 10 11 12

Given the following code: 1 2 2345 DATASTRUCTURE test = new DATASTRUCTURE(); test.add(10); test.add(30); test.add(15); 5 test.add(1); 6 7 8 9 10 11 12 test.add(3); test.add(test.delete()) test.add(test.delete()); test.add(100); test.add(33); test.add(test.delete()) test.add(999) Assume we can change the DATASTRUCTURE class to either a stack or a queue class. Show the contents of DATASTRUCTURE with indexes after all lines of code above have been executed. Show the contents of DATASTRUCTURE when DATASTRUCTURE is a stack and also when DATASTRUCTURE is a queue.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
