My Report (&Account)

Stack Operation Test


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)

1. Convert the following Infix expression to Postfix form using a stack.
x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

2. The type of expression in which operator succeeds its operands is?

3. If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, what is the order of removal?

4. Assume that the operators +,-, x are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, x, +, -. The postfix expression for the infix expression a + b x c – d ^ e ^ f is?

5. The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?

6. Which of the following statement(s) about stack data structure is/are NOT correct?

7. Which of the following is not an inherent application of stack?

8. Consider the following operation performed on a stack of size 5.

Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);

After the completion of all operation, the number of elements present in stack is?

9. Convert the following infix expressions into its equivalent postfix expressions.
(A + B ⋀D)/(E - F)+G


 

Start practicing “1000 MCQs on Data Structure”, and once you are ready, you can take tests on all topics by attempting our “Data Structure Test Series”.

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.