Here is an infix expression: 4 + 3*(6*3-12). Suppose that we are using the usual stack algorithm to convert the expression from infix to postfix notation. The maximum number of symbols that will appear on the stack AT ONE TIME during the conversion of this expression?
a) 1
b) 2
c) 3
d) 4
Answer: d
Explanation: When we perform the conversion from infix to postfix expression +, *, (, * symbols are placed inside the stack. A maximum of 4 symbols are identified during the entire conversion.
Related Posts
What is the need for a circular queue?
What does the following Java code do?
public Object function()
{
if(isEmpty())
return -999;
else
{
Object high;
high = q[front];
return high;
}
}What is the term for inserting into a full queue known as?
In a circular queue, how do you increment the rear end of the queue?
Which of the following properties is associated with a queue?
Minimum number of queues to implement stack is ___________
Which of the following data structures can be used for parentheses matching?
Join The Discussion