Bissoy
Login
Get Advice on Live Video Call
Earn $ Cash $ with
consultations on Bissoy App
What is the time complexity of an infix to postfix conversion algorithm?
A
O(N log N)
B
O(N)
C
O(N2)
D
O(M log N)
Correct Answer:
O(N)
The time complexity of an infix to postfix expression conversion algorithm is mathematically found to be O(N).
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
Given two processes (conversion of postfix equation to infix notation and conversion of prefix notation to infix notation), which of the following is easier to implement?
A
Both are easy to implement
B
Conversion of postfix equation to infix equation is harder than converting a prefix notation to infix notation
C
Conversion of postfix equation to infix equation is easier than converting a prefix notation to infix notation
D
Insufficient data
To convert the postfix expression into the infix expression we use stack and scan the postfix expression from left to right.
A
True
B
False
Which of the following statement is incorrect with respect to infix to postfix conversion algorithm?
A
operand is always placed in the output
B
operator is placed in the stack when the stack operator has lower precedence
C
parenthesis are included in the output
D
higher and equal priority operators follow the same condition
In infix to postfix conversion algorithm, the operators are associated from?
A
right to left
B
left to right
C
centre to left
D
centre to right
Parentheses are simply ignored in the conversion of infix to postfix expression.
A
True
B
False
What is the time complexity of evaluation of postfix expression algorithm?
A
O (N)
B
O (N log N)
C
O (N2)
D
O (M log N)
Which data structure is needed to convert infix notation to postfix notation?
A
Tree
B
Branch
C
Stack
D
Queue
Convert the following infix expressions into its equivalent postfix expressions. (A + B ⋀D)/(E – F)+G
A
(A B D ⋀ + E F – / G +)
B
(A B D +⋀ E F – / G +)
C
(A B D ⋀ + E F/- G +)
D
(A B D E F + ⋀ / – G +)
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.
A
xyz*+pq*r+s*+
B
xyz*+pq*r+s+*
C
xyz+*pq*r+s*+
D
xyzp+**qr+s*+