DEV Community

Mujahida Joynab
Mujahida Joynab

Posted on

Stack

It follows a technique that is LIFE . LIFO - Last In First Out .

What is stack ?
Assume we have stack of plates or stack of chairs . How does it work?

The top of the plate is called top . Keeping a plate above another plate is called push .
If we want to delete a plate we will first delete the top plate . It is called pop out .

Let's take a example with some integer value
Push - 10
10 - Top
Push - 20
20 - Top
10

Push - 30
30 - Top
20
10

If we want to pop
30 will pop out
20 - Top
10
Again pop
20 is pop
10
Again pop
Null

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay