0 votes 0 votes 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. 12 or 24?? abhishek tiwary asked Dec 5, 2017 abhishek tiwary 330 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments Ashwin Kulkarni commented Dec 5, 2017 reply Follow Share It max() does not push or pop something into stack? Its just gives answer to user is it true? if yes then ans will be 12. After all operations 5,6,5 will be present in the stack! 0 votes 0 votes abhishek tiwary commented Dec 5, 2017 reply Follow Share @ Ashwin Kulkarni yes 12 i am also thinking like this but in made easy sol they are maintaining two columns and increases the size by 24 i do not know why?? 0 votes 0 votes sathvikchiramana commented Jul 14, 2018 reply Follow Share Ans is 32...Refer geeksforgeeks https://www.google.co.in/amp/s/www.geeksforgeeks.org/tracking-current-maximum-element-in-a-stack/amp/ 0 votes 0 votes Please log in or register to add a comment.