View Single Post
 
Old April 27th, 2007, 10:17 AM
ciderpunx ciderpunx is offline
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Imagine your stack goes from left to right like this:

1 2 3 4

pop($stack) removes the 1 from the left of the stack and you're left with

2 3 4

push($stack, 5) pushes 5 on to the left of the stack so you're left with

5 2 3 4

Normally people think of stacks vertically with what I've called the left at the top.

HTH

--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock: http://charlieharvey.org.uk