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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, lailahussain99
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
image
Computers and Technology, 22.06.2019 19:30, keke6361
When using a public computer or network, you should always
Answers: 2
image
Computers and Technology, 22.06.2019 22:00, bbysl15
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
image
Computers and Technology, 23.06.2019 02:30, bre563
Research data that is presented using descriptive language is said to be
Answers: 2
You know the right answer?
HW4:

1) Implement MyArrayStack (constructor, push, pop, peek and isEmpty), and MyLinked...

Questions in other subjects:

Konu
Mathematics, 12.12.2020 16:30
Konu
Physics, 12.12.2020 16:30
Konu
Mathematics, 12.12.2020 16:30
Konu
Mathematics, 12.12.2020 16:30