Explain The Rationale For Returning A Boolean Value From The Addentry Bag Operation 3496649

All questions are in Java: 1. explain the rationale for returning a boolean value from the addEntry bag operation 2. explain why the set ADT does not need a getFrequencyOf operation 3. Draw the resultant stack after the following operations. Label the top entry of your stack. push(X), push(Q), push(Y), peek(), pop(), push(T), peek() 4. Convert the following infix expression to a postfix expression w * (x + y) / z 6. In an array based implementation of a stack ADT, explain why is it a bad idea to use first location of the array to reference the top of a stack 7. draw the contents of a queue after the following statements execute. Clearly label the front and back of the queue. QueueInterface bankLine = new LinkedQueue <>(); bankLine.enqueue(“John”); bankLine.enqueue(“Mathew”); String next = bankLine. dequeue(); next = bankLine.dequeue(); bankLine.enqueue(“Drew”); bankLine.enqueue(“Heather”); next=bankLine.dequeue(); bankLine.enqueue(“David”); next= bankLine.dequeue(); 8. Draw the contents of a deque after the following statements execute. Clearly label the front and back of the deque. DequeInterface waitingLine = new LinkedDeque<>(); waitingLine.addToBack(“Adam”); waitingLine.addToFront(“Rudy”); waitingLine.addToBack(“Larry”); waitingLine.addToBack(“Sam”); waitingLine.addToFront(“Jack”); String name = waitingLine.getFront(); name=getFront();

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW