Infix Prefix Postfix
Infix Prefix Postfix
b) AB + CD* E - F **G /
c) AB + CD* E - *F *G /
d) AB + CDE * - * F *G /
a) *AB/CD+
b) AB*CD/+
c) A*BC+/D
d) ABCD+/*
a) Branch
b) Tree
c) Queue
d) Stack
4. The prefix form of A-B/ (C * D ⋀ E) is?
a) -/*⋀ACBDE
b) -ABCD*⋀DE
c) -A/B*C⋀DE
d) -A/BC*⋀DE
a) X
b) Null
c) S
d) None
ANSWER: a) X
a) + pq - *rt
b) - +pqr * t
c) - +pq * rt
d) - + * pqrt
7. The result of evaluating the postfix expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?
a) 600
b) 350
c) 650
d) 588
8. 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) None
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) none
10. What is the postfix expression for the corresponding infix expression? a+b*c+(d*e)
a) abc*+de*+
b) abc+*de*+
c) a+bc*de+*
d) abc*+(de)*+
11. What is the postfix expression for the following infix expression? a/b^c-d
a) abc^/d-
b) ab/cd^-
c) ab/^cd-
d) abcd^/-
12. What is the corresponding postfix expression for the given infix expression? a*(b+c)/d
a) ab*+cd/
b) ab+*cd/
c) abc*+/d
d) abc+*d/
13. What is the corresponding postfix expression for the given infix expression? a+(b*c(d/e^f)*g)*h)
a) ab*cdef/^*g-h+
b) abcdef^/*g*h*+
c) abcd*^ed/g*-h*+
d) abc*de^fg/*-*h+
14. What is the correct postfix expression for the following expression?
a+b*(c^d-e)^(f+g*h)-i
a) abc^de-fg+*^*+i-
b) abcde^-fg*+*^h*+i-
c) abcd^e-fgh*+^*+i-
d) ab^-dc*+ef^gh*+i-
15. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal
a. ABFCDE
b. ADBFEC
c. ABDECF
d. ABDCEF
16. Which data structure is needed to convert infix notation to postfix notation?
a) Branch
b) Tree
c) Queue
d) Stack
a) (a+b)*(c+d)
b) ab+c*
c) +ab
d) abc+*
a) O(N log N)
b) O(N)
c) O(N2)
d) O(M log N)