Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question No: 1 Marks:7+7 Consider the following infix expression 3 2 + 5 * 4 3 -

ID: 3610454 • Letter: Q

Question

Question No: 1 Marks:7+7

Consider the following infix expression

3 2 + 5 * 4 3 - 18 / 9

Convert it into postfix expression using stack.

Write each step of this conversion using the followingtable.

Symbol

Postfix

Stack

Evaluate the postfix expression of part (a) using stack.

Write each step of this evaluation using the followingtable.

Input

operand 1

operand 2

value

stack

Question No: 2 Marks:3+3

Consider the following binary search tree, and answer thefollowing questions

What will be the result of?

Inorder Traversal

Postorder Traversal

Symbol

Postfix

Stack

Explanation / Answer

input op1 op 2   val      stack

3

3

2

3, 2

3

2

9

9

5

9,5

4

9, 5, 4

3

9, 5, 4,3

4

3

64

9 ,5, 64

*

5

64

320

9, 320

+

9

320

329

329

19

329 ,18

9

329, 19,9

/

18

9

2

329, 2

-

329

2

327

327

3

3

2

3, 2

3

2

9

9

5

9,5

4

9, 5, 4

3

9, 5, 4,3

4

3

64

9 ,5, 64

*

5

64

320

9, 320

+

9

320

329

329

19

329 ,18

9

329, 19,9

/

18

9

2

329, 2

-

329

2

327

327

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote