subject
Computers and Technology, 01.04.2020 22:09 yedida

HW4:

1) Implement MyArrayStack (constructor, push, pop, peek and isEmpty), and MyLinkedQueue with both next and previous pointers (constructor enqueuer/offer, dequeuer/poll, peek and isEmpty), and write the following two program to test them.

2) For stack testing, write a program to check if a string has matching parenthesis such as "(O)", but not "(.

3) For stack testing, use it to "Evaluating Expressions" using the algorithm given below.

The Algorithm for Step 3:

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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
question
Computers and Technology, 23.06.2019 23:00
How do you know if the website is secure if you make a purchase
Answers: 2
You know the right answer?
HW4:

1) Implement MyArrayStack (constructor, push, pop, peek and isEmpty), and MyLinked...
Questions
question
Mathematics, 16.01.2022 23:10
question
Mathematics, 16.01.2022 23:10
question
Mathematics, 16.01.2022 23:20
Questions on the website: 13722360