Stack A has the eintries a, b, c (with a on top), Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of stack B can only be printed. In the arrangement, which of the following permutations of a, b, c is not possible?
A. | b a c |
B. | b c a |
C. | c a b |
D. | a b c |
Option: C Explanation : Click on Discuss to view users comments. |
The postfix equivalent of the prefix * + a b - c d is
A. | ab+cd-* |
B. | ab cd + - * |
C. | ab + cd * - |
D. | ab + - cd * |
Option: A Explanation : The tree whose preorder traversal yields * + A B – C D, is given in fig 6.18. Writer the post-order traversal of the tree. That is the postfix form. Click on Discuss to view users comments. Rishi said: (12:26am on Sunday 23rd June 2013)
Prefix Form : * ab-cdInfix Form : (a b)*(c-d)Postfix Form : ab cd-*
|
Stacks cannot be used to
A. | eevaluate an arithmetic expression in postfix form |
B. | iumplemen recursion |
C. | convert a given arithmetic expression in infix form to its equivalent postfix form |
D. | allocate resources (like CPU) by the operating system |
Option: D Explanation : Click on Discuss to view users comments. |