mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 23:21:18 +08:00
Translate stack into Russian. (#277)
This commit is contained in:
parent
f53eb17665
commit
d67db50a3b
@ -1,5 +1,9 @@
|
|||||||
# Stack
|
# Stack
|
||||||
|
|
||||||
|
_Read this in other languages:_
|
||||||
|
[_简体中文_](README.zh-CN.md),
|
||||||
|
[_Русский_](README.ru-RU.md)
|
||||||
|
|
||||||
In computer science, a **stack** is an abstract data type that serves
|
In computer science, a **stack** is an abstract data type that serves
|
||||||
as a collection of elements, with two principal operations:
|
as a collection of elements, with two principal operations:
|
||||||
|
|
||||||
@ -13,7 +17,7 @@ the stack. The name "stack" for this type of structure comes
|
|||||||
from the analogy to a set of physical items stacked on top of
|
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
|
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
|
of the stack, while getting to an item deeper in the stack
|
||||||
may require taking off multiple other items first
|
may require taking off multiple other items first.
|
||||||
|
|
||||||
Simple representation of a stack runtime with push and pop operations.
|
Simple representation of a stack runtime with push and pop operations.
|
||||||
|
|
||||||
|
23
src/data-structures/stack/README.ru-RU.md
Normal file
23
src/data-structures/stack/README.ru-RU.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Стек
|
||||||
|
|
||||||
|
Стек (англ. stack — стопка) — абстрактный тип данных, представляющий собой
|
||||||
|
список элементов, организованных по принципу LIFO (последним пришёл — первым вышел).
|
||||||
|
|
||||||
|
Стек имеет две ключевые операции:
|
||||||
|
* **добавление (push)** элемента в конец стека, и
|
||||||
|
* **удаление (pop)**, последнего добавленного элемента.
|
||||||
|
|
||||||
|
Дополнительная операция чтения головного элемента (peek) даёт доступ
|
||||||
|
к последнему элементу стека без изменения самого стека.
|
||||||
|
|
||||||
|
Чаще всего принцип работы стека сравнивают со стопкой тарелок: чтобы взять вторую
|
||||||
|
сверху, нужно снять верхнюю.
|
||||||
|
|
||||||
|
Иллюстрация работы со стеком.
|
||||||
|
|
||||||
|
![Стек](https://upload.wikimedia.org/wikipedia/commons/b/b4/Lifo_stack.png)
|
||||||
|
|
||||||
|
## Ссылки
|
||||||
|
|
||||||
|
- [Wikipedia](https://ru.wikipedia.org/wiki/%D0%A1%D1%82%D0%B5%D0%BA)
|
||||||
|
- [YouTube](https://www.youtube.com/watch?v=tH8qi7lej5U)
|
Loading…
Reference in New Issue
Block a user