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

b. add c) push peek 9- Given the following infix expression, which one of the fo

ID: 3587086 • Letter: B

Question


b. add c) push peek 9- Given the following infix expression, which one of the following is the corresponding p expression? e. none of the above Using the evaluatePostfix algorithm, evaluate the following postfix expression. 72+4 10- (Note that the first operand is 7 and the second operand is 2). e 15 13 8. 36 h. 18 ollowing are short answer questions: 11- Suppose that s and t are empty stacks and a, b, c, and d are objects. What do t stacks contain after the following sequence of operations executes? s.push(a); b, c,d,a s push(b); a, c, d, b s,push(c); a, b, d,c t.push(d); t.push(s.pop)); t.push(s.peek0); s.push(t.pop)); t.pop();

Explanation / Answer

I didnot understand whether to answer all the questions or the missing parts of the last question. I am answering the missing part of last question as they are unfilled. Please comment for any further help.

11.

s.push(a); -->a
Pushing a as first element in the stack s
s.push(b); -->a-->b
Pushing b
s.push(c); -->a-->b-->c
Pushing c
t.push(d); -->d
Pushing d as first element in the stack t
t.push(s.pop()); -->d-->c
Popping the top int of s which is c and pushing in to t
t.push(s.peek()); -->d --> c --> b
Pushing the peek int of the stack s to stack t
s.push(t.pop()); -->a -->b --> b
Popping the top int of t which is b and pushing in to s
t.pop(); --> -->a
pops the peek element b

**Comment for any further queries. Upvote if the answer is satisfactory.