JavaAlgorithms/DataStructures/Stacks
mohamadAmin 01179a3de6
create Readme.md for stacks (#2279)
* create Readme.md for stacks

* Update README.md

Co-authored-by: Yang Libin <contact@yanglibin.info>
2021-08-23 11:07:33 +08:00
..
BalancedBrackets.java Formatted with Google Java Formatter 2020-10-24 10:23:28 +00:00
DecimalToAnyUsingStack.java Formatted with Google Java Formatter 2020-10-24 10:23:28 +00:00
InfixToPostfix.java Format with google formatter 2020-10-27 11:23:46 +08:00
NodeStack.java Formatted with Google Java Formatter 2020-10-24 10:23:28 +00:00
README.md create Readme.md for stacks (#2279) 2021-08-23 11:07:33 +08:00
StackArray.java Formatted with Google Java Formatter 2020-10-24 10:23:28 +00:00
StackArrayList.java Formatted with Google Java Formatter 2020-10-24 10:23:28 +00:00
StackOfLinkedList.java Formatted with Google Java Formatter 2020-10-24 10:23:28 +00:00

STACK

stack is an ADT (abstract data type ) that act like list of objects but there is a diffrents.

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.

stack is bast on two methods ( functions)

push & pop

push: add an alement to last index of stack.

for example: we have 1, 3, 5 in stack, then we call push(9),

9 will add to last index of stack -> 1, 3, 5 , 9

pop: remove the last element from stack. for example: we have 1, 3, 5 , 9 in stack, then we call pop(),

the function will return 9 and the stack will change to 1, 3, 5.