edited by
480 views
1 votes
1 votes
i got  ans 24but given ans is 32 please correct me.

Consider an efficient implementation of a data structure STACK-MAX that support an operation “max( )” that reports the current maximum among all elements in the stack. Normal stack operations i.e., push, pop are also to be supported. The size of above data structure after performing following operation push (5), push (6), push (7), push(8), pop, max, push (2), push (9), pop, pop, max, push (5) is Y (in bytes). Assume that an integer can be stored in 4 bytes.
What is the value of Y?
edited by

1 Answer

Related questions

9 votes
9 votes
5 answers
1
target2017 asked Jan 7, 2017
2,967 views
How it is 24? I'm not getting it.
2 votes
2 votes
1 answer
2
Thor-o-s asked Sep 1, 2022
391 views
Can anyone please explain how to find “ i “ smallest elements from an array whose elements are distinctPlease use max heap to explain the working input : n distinct e...
0 votes
0 votes
1 answer
3
Overflow04 asked Jun 29, 2022
2,069 views
Someone please explain the login behind the explanation.
0 votes
0 votes
1 answer
4