851 views
0 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.

Position:
Show:

Related questions

1 1 vote
1 1 answer
237
237 views
Titiksha_Gupta asked Jan 5
237 views
4 4 votes
2 answers 2 answers
461
461 views
harishdewangan asked Aug 9, 2025
461 views
Consider following two functions in c: int f1(int n) int f2(int n){ ...
0 0 votes
1 1 answer
480
480 views
gaurav_sah asked Apr 23, 2025
480 views
faster access to non local variables is achived using an array pointers to activation records called a stack , heap , display , activation tree?
3 3 votes
1 answers 1 answer
1.1k
1.1k views
saket jaiswal asked Jan 22, 2025
1,086 views
#include <stdio.h int main() { int x = 10, y = 5, z = 2; int result = x y ? y z ? 1 : z x ? 2 : 3 : y z ? 4 : z x ? 5 : 6; printf("%d", result); retu...