in DS edited by
484 views
1 vote
1 vote
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?
in DS edited by
484 views

1 Answer

0 votes
0 votes

solution is right?