Question: The array stack , linked stack and pririty queue methods HW4: Implement MyArrayStack (constructor, push, pop, peek and isEmpty), MyLinkedStack (constructor push, pop, peek and
HW4: Implement MyArrayStack (constructor, push, pop, peek and isEmpty), MyLinkedStack (constructor push, pop, peek and isEmpty) and MylinkedQueue (constructor, offer, poll,peek and isEmpty), and write the following two program to test them. (10 points) For stack testing, write a program to check if a string has matching parenthesis such as "(O), but not "Y For stack testing, use it to "Evaluating Expressions" (10 points) Phase 1: Scanning the expression The program scans the expression from left to right to extract operands, operators, and the parentheses 1.1. If the extracted item is an operand, push it to operandStack. 1.2. If the extracted item is a + or- operator, process all the operators at the top of operatorStack and push the extracted operator to operatorStack. 1.3. If the extracted item is a or /operator, process the or /operators at the top of operatorStack and push the extracted operator to operatorStack 1.4. If the extracted item is a (symbol, push it to operatorStack 1.5. If the extracted item is a ) symbol, repeatedly process the operators from the top of operatorStack until seeing the ( symbol on the stack. Phase 2: Clearing the stack Repeatedly process the operators from the top of operatorStack until operatorStack is empty. Bonus: support for exponent A and use HashMap for counting keyword occurrence in a Java program. Due Oct 26 11:59pm, 2018
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
