1. Which of the following does the balancing symbols algorithm include?
2. Find the error (if any) in the following code snippet for pop operation.
void pop() //removing an element from a stack
{
printf(“%s”, stack[top++]);
}
void pop() //removing an element from a stack
{
printf(“%s”, stack[top++]);
}
3. What would be the solution to the given prefix notation?
- * 1 5 / * / 6 3 6 2
- * 1 5 / * / 6 3 6 2
4. Which data structure can be used to test a palindrome?
5. Evaluate the following statement using infix evaluation algorithm and choose the correct answer. 4*2+3-5/5
6. The result of the postfix expression 5 3 * 9 + 6 / 8 4 / + is . . . . . . . .
7. When an operand is read, which of the following is done?
8. Find the output of the following prefix expression.
*+2-2 1/-4 2+-5 3 1
*+2-2 1/-4 2+-5 3 1
9. Which of the following is an example for a postfix expression?
10. What should be done when a left parenthesis '(' is encountered?
Read More Section(Stacks in Data Structures)
Each Section contains maximum 100 MCQs question on Stacks in Data Structures. To get more questions visit other sections.