Question: QUESTION 1 (a), (b), (c), (d) and (e) Please help to solve Question 1 (a, b, c, d, and e) thank you. Need solving steps

QUESTION 1 (a), (b), (c), (d) and (e)

 QUESTION 1 (a), (b), (c), (d) and (e) Please help to

solve Question 1 (a, b, c, d, and e) thank you. Need

Please help to solve Question 1 (a, b, c, d, and e) thank you. Need solving steps too.

a. What are basic operations for stacks? (4 marks) b. If the sequence of operations as shown in below are performed on a stack, write the sequence of popped out values. Push (A); Push (B); Pop; Push (A); Push (B); Pop; Pop; Pop; Push (B); (4 marks) c. Fill in the missing lines of code (i-vii) in C++ for stack class declaration in Figure 1. This class uses array implementation that have data members and methods of basic stack operations. (12 marks) const int size = 100; template class Stack { private: i) ; //top position of array index ii) //array public: iii) .; //constructor ; //insert an item v) ; //remove an item vi) ; //return the top item vii) //check for empty stack //end stack class Figure 1: Stack class declaration Convert the following infix expression to postfix form: i) (a+b) * (c+d) ii) x + (y - z) (4 marks) Use stack algorithm to evaluate postfix expression given and DRAW diagrams to show the status of the stack after each step. 6 52 3 + 8 * + 3+ * (16 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!