Consider the following sequence of operations on three empty stacks (S1, S2, S3) in a consecutive manner:
|
Operation on Stack |
Stack in use |
|
PUSH(3) |
S1 |
|
PUSH(13) |
S2 |
|
PUSH(23) |
S1 |
|
PUSH(15) |
S3 |
|
PUSH(7) |
S1 |
|
PUSH(17) |
S3 |
|
PUSH(27) |
S2 |
|
POP() |
S2 |
|
PUSH(19) |
S1 |
|
PUSH(27) |
S2 |
|
POP() |
S1 |
|
POP() |
S3 |
|
P = POP() |
S1 |
|
Q = POP() |
S2 |
|
R = POP() |
S3 |
What will be the result of ((Q-P)+R-10)/5 this expression?
Note: The P,Q,R are variable which holds the value of that respective operation.
1
17
2
5
3
25
4
15