859 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
249
249 views
Titiksha_Gupta asked Jan 5
249 views
4 4 votes
2 answers 2 answers
469
469 views
harishdewangan asked Aug 9, 2025
469 views
Consider following two functions in c: int f1(int n) int f2(int n){ ...
0 0 votes
1 1 answer
488
488 views
gaurav_sah asked Apr 23, 2025
488 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,120 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...