Stack memory diagram for Array sorted and First Index

sir, can you please present a Stack memory diagram of different stages while stack is building and falling for both Array sorted and First Index problems so that we can understand this even better.

Try yourself it is very easy.
If you make a mistake i will help you
send me screenshot
I will correct

sir, can you please verify this

its wrong

Stack pop will look like this

1 Like