0% found this document useful (0 votes)
9 views1 page

Algo Stacks

Stacks are a linear data structure that follow the last-in, first-out (LIFO) principle, where the last item added is the first item removed. Stacks have five basic operations - push, pop, peek, isFull, and isEmpty. Real-life examples of stacks include stacking chairs, where the last chair added is on top and removed first, and browser history, where the most recently visited page is at the top of the stack.

Uploaded by

anime 24 life
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Algo Stacks

Stacks are a linear data structure that follow the last-in, first-out (LIFO) principle, where the last item added is the first item removed. Stacks have five basic operations - push, pop, peek, isFull, and isEmpty. Real-life examples of stacks include stacking chairs, where the last chair added is on top and removed first, and browser history, where the most recently visited page is at the top of the stack.

Uploaded by

anime 24 life
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.

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.

ONE REAL-LIFE APPLICATION SCENARIO


One real life application that can be found using stack is stacking a chair this
show a real life application about how the stack function work because the last
chair that we stack will be on the very top then when we want to use the chair
we will take the very first chair at the top. The stack application is the most
appropriate for this situation because it can make the job more easy so that
the person who will take the chair don’t have to use his strength to lift up all of
the chair to take the one at the bottom but instead take the easier one at the
top .

ONE COMPUTING APPLICATION SCENARIO


The computing application that can be found using the stacks data structure are history of visited
web that can be found in google or any other web browser. The use of stacks data structure is
necessary this because it can help in careless situation for example if someone accidently close the
tab that he are browsing he can just go to the history and it will be at the very top this will make it
easy for the person to search for that tab instead if the history don’t use the stacks structure the
person have to scroll until the very last for the tab he just browse.

You might also like