Algo Stacks
Algo Stacks
Stacks
Stacks is a type of data structure that store data or element in a linear fashion which can store many
data but stacks also have a unique approach which the data that been stack follow the order (LIFO)
which is last in, first out for example if there are three number 2,3 and 4 the last number that been
stacks is 4 then when the output is called the first number appear will be 4 then follow the order 3
and 2.
The stacks also have 5 operation in it that is.
push – Adds or pushes an element into the stack.
pop – Removes or pops an element out of the stack.
peek – Gets the top element of the stack but doesn’t remove it.
isFull – Tests if the stack is full.
isEmpty – Tests if the stack is empty.