330 views
0 votes
0 votes
  1. 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), pop, max, push (6), push (8), pop, pop, max, push (5) is ________ (in bytes). Assume that an integer can be stored in 4 bytes.
  2. 12 or 24??

Please log in or register to answer this question.

Related questions

0 votes
0 votes
1 answer
1
0 votes
0 votes
1 answer
2
tishhaagrawal asked Dec 16, 2023
360 views
Below is my approach to solving this question, can anyone please explain if I am doing it the right way?Let X = #free slotssince, m =7 and n = 3So, $4 \leqslant x\leqsla...
0 votes
0 votes
0 answers
3
Dadu asked Dec 7, 2023
215 views
Please solve I am unable to understand the solution given by made easy