push x on the stack
Header node I.e. top
element
pointer
St
If stack is empty put head/top pointing at node to be added
else link node to be added to existing stack and move head/top
to point at it.
Don’t forget to increment the size of the stack if keeping a record!
Previous slide
Next slide
Back to first slide
View graphic version