where are the popped elemnts from stack stored?in this question why the elements in helper stack adding from 10 at index 0 .When 50 is popped first why 50 is not added at helper index 0
Stck pop operation
Hey @Par1hsharma
[10,20,30,40,50] <- top org Stack
[ ] <- top helper Stack
pop 50 from org Stack
[ 50] <- top helper Stack
pop 40 from org Stack
[50,40] <- top helper Stack
pop 30 from org Stack
[50,40,30 ] <- top helper Stack
pop 20 from org Stack
[ 50, 40 ,30 ,20 ] <- top helper Stack
pop 10 from org Stack
[50,40,30,20,10] <- top helper Stack
org stack = helper Stack
we can do this way
but Bhaiya said, do not use this concept.
isliye 50 is not added at helper index 0