HR Interview
Interview
Programming
Technical
Priya has a box that looks like a stack and she does the following operations on empty box
PUSH(8)
PUSH(7)
POP
PUSH(1)
PUSH(3)
A. 31_8
B. 8_1_7
C. 8_1_
D. None of these
Read Solution (Total 3)
-
- A
first I pushed 8
and then Pushed 7
now top of the stack will be 7 when we performed a pop operation we get 7 out and again push 1 now stack contain 18 next pushed 3 now stack contain 318 - 5 years agoHelpfull: Yes(1) No(0)
- Answer: A) first 8 will go in the stack then 7 after this pop operation, 7 pops out. then 1 and 3 will be inserted at final we will have 3 1 8
- 5 years agoHelpfull: Yes(0) No(0)
- Answer :A) Stack is folows last in first out in that case insert 8,7 and after we use pop operation in that case 7 was deleted because top element is 7 and then insert 1,3 values.in case of displace top element should be display in it.
- 5 years agoHelpfull: Yes(0) No(0)
HR Interview Other Question