Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
Stack
Edit
PageHistory
Diff
Info
LikePages
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]. The term was coined by EdsgerWybeDijkstra. 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. 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. An easy way to implement such a flexible [Stack] is to use a LinkedList and keep both a head and a tail [Pointer]. ''AddToMe: use of [Stack]s for flow control on machine level in [CPU]s, with a mention of [BufferOverflow]s.''
6 pages link to
Stack
:
Forth
BST
AssemblyLanguage
JavaDebuggingHints
EdsgerWybeDijkstra
BufferOverflow