File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
src/data-structures/stack Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 11# Stack
22
3+ _ Read this in other languages:_
4+ [ _ 简体中文_ ] ( README.zh-CN.md ) ,
5+ [ _ Русский_ ] ( README.ru-RU.md )
6+
37In computer science, a ** stack** is an abstract data type that serves
48as a collection of elements, with two principal operations:
59
@@ -13,7 +17,7 @@ the stack. The name "stack" for this type of structure comes
1317from the analogy to a set of physical items stacked on top of
1418each other, which makes it easy to take an item off the top
1519of the stack, while getting to an item deeper in the stack
16- may require taking off multiple other items first
20+ may require taking off multiple other items first.
1721
1822Simple representation of a stack runtime with push and pop operations.
1923
Original file line number Diff line number Diff line change 1+ # Стек
2+
3+ Стек (англ. stack — стопка) — абстрактный тип данных, представляющий собой
4+ список элементов, организованных по принципу LIFO (последним пришёл — первым вышел).
5+
6+ Стек имеет две ключевые операции:
7+ * ** добавление (push)** элемента в конец стека, и
8+ * ** удаление (pop)** , последнего добавленного элемента.
9+
10+ Дополнительная операция чтения головного элемента (peek) даёт доступ
11+ к последнему элементу стека без изменения самого стека.
12+
13+ Чаще всего принцип работы стека сравнивают со стопкой тарелок: чтобы взять вторую
14+ сверху, нужно снять верхнюю.
15+
16+ Иллюстрация работы со стеком.
17+
18+ ![ Стек] ( https://upload.wikimedia.org/wikipedia/commons/b/b4/Lifo_stack.png )
19+
20+ ## Ссылки
21+
22+ - [ Wikipedia] ( https://ru.wikipedia.org/wiki/%D0%A1%D1%82%D0%B5%D0%BA )
23+ - [ YouTube] ( https://www.youtube.com/watch?v=tH8qi7lej5U )
You can’t perform that action at this time.
0 commit comments