Notes

Source: 📖 Problem Solving with Algorithms and Data Structures using Python

Date: 2021-10-28


What is a stack?

A stack is a type of Last In First Out (LIFO) linear data structure. Stacks have a base and a top, and they operate like a stack of of trays on a counter – as you add a new tray, you add it to the top of the stack. When removing a tray, you remove the tray that is at the top of the stack – the last tray to be placed.