Skip to main content

Posts

Showing posts with the label stack

Course Review: learn python data structures: list, queue and others

 Introduction: On a very bright friday, I don't have any specific hard task in my hands and therefore decided to explore a linkedin learning course. I would like to thank my current employer at the time of writing this blog; IQuanti for availing us the free linkedin learning.  In this post, we are going to review and provide key points from the course about learning python data structures. It is designed and created by Erin allard. Now, let's dive in. First concept: Abstract data types: What is abstract data types? "abstract data types are abstract theoretical computer science concept which defines what type of data a data structure can hold and how can we interact with that data." In case of creating new abstract data types, we have to therefore define both the data and ways to interact with it. But in the course, we are going to explore stack, queues and other well established structures; for which the formats are already well known.  It is also important to un...

stack

Introduction: The stack is a linear data structure. A stack can be conceptualized by a stack of dishes, kept one upon another. As the dish which is at the top has to be removed at the first to get the depth of the stack, the stack is called a first in last out or last in first out structure. This is abbreviated as LIFO. A stack, as it can be imagined as a one-side open tube, has one opening only and therefore it has to store this opening as a pointer when it is implemented. This pointer is named "top". A stack has 5 normal functions to work with. It has a peek function which helps to look at the top of the stack and know the value. It has a push function to push a value from the top. And then there is a pop function which deletes the top value each time it is called. The other two functions are rather technical as such isempty() is a standard function to check whether the stack is empty or not and the isfull() is a similar one to check whether the stack is full or...