Computer Science

What is Stack? Why is it called LIFO data structure?

Python Stack

5 Likes

Answer

A stack is a linear/sequence structure or a list of elements in which insertion and deletion can take place only at one end, i.e., Stack's top. Because of this, Stack is called LIFO data structure. The Last-In-First-Out (LIFO) means the element inserted last would be the first to be deleted or accessed from the stack.

Answered By

2 Likes


Related Questions