when only 5, 3 are present in the stack with current_minimum = 3 and top being pointing to 5. When we call getmin function it would use the formula: 2current_min - element to be pop = 23 - 5 =1, which gives new current min as 1which is incorrect???
Output seems to be incorrect when we call getminimum when only 5,3 are present in stack, not expalined in video
@vikrantwaje96 curr_element stores the values of the elements as it is, getmin function is returning that value only.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.