Skip to content

Commit 3fad373

Browse files
committed
Add README.
1 parent 248f1bc commit 3fad373

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/data-structures/stack/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Stack
2+
3+
In computer science, a stack is an abstract data type that serves
4+
as a collection of elements, with two principal operations:
5+
6+
* **push**, which adds an element to the collection, and
7+
* **pop**, which removes the most recently added element that was not yet removed.
8+
9+
The order in which elements come off a stack gives rise to its
10+
alternative name, LIFO (last in, first out). Additionally, a
11+
peek operation may give access to the top without modifying
12+
the stack. The name "stack" for this type of structure comes
13+
from the analogy to a set of physical items stacked on top of
14+
each other, which makes it easy to take an item off the top
15+
of the stack, while getting to an item deeper in the stack
16+
may require taking off multiple other items first
17+
18+
Simple representation of a stack runtime with push and pop operations.
19+
20+
![Stack](https://upload.wikimedia.org/wikipedia/commons/b/b4/Lifo_stack.png)
21+
22+
## References
23+
24+
[Wikipedia](https://en.wikipedia.org/wiki/Stack_(abstract_data_type))

0 commit comments

Comments
 (0)