mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-28 07:59:42 +08:00
95641c8aaf
* Create README.fr-FR.md * Translate to french "Priority Queue" module * Add english lang redirection * Update README.fr-FR.md * Update README.fr-FR.md * Add French lang version redir * Create README.fr-FR.md * Added french translation for Queue * Added French lang redir * Update README.md * Create README.fr-FR.md * Add french translation * Index french translation * Create README.fr-FR.md * Add french translation * Index french translation * Fix translation * Create README.fr-FR.md * Add french translation * Index french translation * Add wikipedia french reference * Add french wikipedia reference |
||
---|---|---|
.. | ||
__test__ | ||
README.fr-FR.md | ||
README.ja-JP.md | ||
README.md | ||
README.pt-BR.md | ||
README.ru-RU.md | ||
README.zh-CN.md | ||
Stack.js |
Stack
Read this in other languages: 简体中文, Русский, 日本語, Français, Português
In computer science, a stack is an abstract data type that serves as a collection of elements, with two principal operations:
- push, which adds an element to the collection, and
- pop, which removes the most recently added element that was not yet removed.
The order in which elements come off a stack gives rise to its alternative name, LIFO (last in, first out). Additionally, a peek operation may give access to the top without modifying the stack. The name "stack" for this type of structure comes from the analogy to a set of physical items stacked on top of each other, which makes it easy to take an item off the top of the stack, while getting to an item deeper in the stack may require taking off multiple other items first.
Simple representation of a stack runtime with push and pop operations.