Sun Microsystem Previous Years Solved Sample Placement Papers
a) +A*CB
b) *B+AC
c) +A*BC
d) *A+CB
Answer: cExplanation: Reverse the equation or scan the equation from right to left. Apply the infix-postfix algorithm. The equation inside the bracket evaluates to CB* and outside the bracket evaluates to A+ therefore getting CB*A+. Reversing this and we get +A*BC.
a) +*AB*CD
b) *+AB*CD
c) **AB+CD
d) +*BA*CD
Answer: aExplanation: Reverse the equation or scan the equation from right to left. Apply the infix-postfix algorithm. The equation inside the brackets evaluate to DC* and BA* respectively giving us DC*BA*+ in the end. Reversing this we get the +*AB*CD.
a) +A*B^CD
b) +A^B*CD
c) *A+B^CD
d) ^A*B+CD
Answer: aExplanation: Reverse the equation or scan the equation from right to left. Apply the infix-prefix algorithm. The preference order in ascending order are as follows +*^. Operators are pushed into the stack and popped if its preference is greater than the one which is getting pushed. In the end all operators are popped. The equation evaluates to DC^B*A+. Reversing this we get our following answer.
a) +
b) $
c) ^
d) &
Answer: cExplanation: According to the algorithm (infix-prefix), it follows that the exponentiation will have the highest priority.
a) +
b) $
c) |
d) &
Answer: cExplanation: According to the algorithm (infix-prefix), it follows that the logical OR will have the lowest priority.
a) ^^^ABCD
b) ^A^B^CD
c) ABCD^^^
d) AB^C^D
Answer: aExplanation: Reverse the equation or scan the equation from right to left. Apply the infix-prefix algorithm. Here we have to remember that the exponentiation has order of associativity from right to left. Therefore the stack goes on pushing ^. Therefore resulting in ^^^ABCD.
a) |&-+ab/cdef
b) &|-+ab/cdef
c) |&-ab+/cdef
d) |&-+/abcdef
Answer: aExplanation: Reverse the equation or scan the equation from right to left. Apply the infix-prefix algorithm. The preference order in ascending order are as follows |&+*/.
a) -+a*/^bcdef
b) -+a*/bc^def
c) -+a*b/c^def
d) -a+*/bc^def
Answer: bExplanation: Reverse the equation or scan the equation from right to left. Apply the infix-prefix algorithm. The preference order in ascending order are as follows +*/^. Brackets have the highest priority. The equations inside the brackets are solved first.
a. true.
b. false.
c. uncertain.
Answer: a. true.a. true.
b. false.
c. uncertain.
Answer: b. false.a. true.
b. false.
c. uncertain.
Answer: a. true.a. true.
b. false.
c. uncertain.
Answer: a. true.a. true.
b. false.
c. uncertain.
Answer: c. uncertain.a. true.
b. false.
c. uncertain.
Answer: b. false.a. true.
b. false.
c. uncertain.
Answer: c. uncertain.a. true.
b. false.
c. uncertain.
Answer: c. uncertain.