Penguin
Annotated edit history of Stack version 1, including all changes. View license author blame.
Rev Author # Line
1 AristotlePagaltzis 1 A DataStructure organized like a stack of books - you can add things on top, ie push them on the [Stack], and remove them from the top, ie pop them off the [Stack]. This also means that you get things out of a [Stack] in reverse insertion order, a principle referred to as [LIFO].
2
3 The term was coined by EdsgerWybeDijkstra.
4
5 With many [Stack] [DataStructure]s, just like with a stack of books, removing or inserting items is possible but much more difficult in locations other than the top.
6
7 Some [Stack]s, such as in [Forth], allow additional advanced operations like rotation - an operation you'd perform on a stack of books by lifting a smaller stack from the top of the complete one, putting them down on the floor, then putting the rest of the original stack on top of it. This way, the item from X elements deep on the original stack comes to the top, while the items above it move to the bottom of the stack.
8
9 An easy way to implement such a flexible [Stack] is to use a LinkedList and keep both a head and a tail [Pointer].
10
11 ''AddToMe: use of [Stack]s for flow control on machine level in [CPU]s, with a mention of [BufferOverflow]s.''