Skip to content

Commit 01179a3

Browse files
create Readme.md for stacks (TheAlgorithms#2279)
* create Readme.md for stacks * Update README.md Co-authored-by: Yang Libin <[email protected]>
1 parent 3a4bd29 commit 01179a3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

DataStructures/Stacks/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# STACK
2+
3+
stack is an ADT (abstract data type ) that act like list of objects but there is a diffrents.
4+
5+
stack act is *LIFO* (Last In First Out), it means that when we want to get an element from the stack we get the last element in the stack.
6+
7+
stack is bast on two methods ( functions)
8+
9+
## push & pop
10+
11+
**push**: add an alement to last index of stack.
12+
13+
for example: we have `1, 3, 5` in stack, then we call push(9),
14+
15+
`9` will add to last index of stack -> `1, 3, 5 , 9`
16+
17+
18+
**pop**: remove the last element from stack.
19+
for example: we have `1, 3, 5 , 9` in stack, then we call pop(),
20+
21+
the function will return `9` and the stack will change to `1, 3, 5`.

0 commit comments

Comments
 (0)