Stack Data Structure Tutorial - What is a Stack?
ฝัง
- เผยแพร่เมื่อ 9 ก.พ. 2025
- So what is a stack? This stack data structure tutorial will show you how to use a stack and what it is. As well as some example uses of it. The video concludes with an example of how to use two stacks to simulate a Queue.
A stack is almost opposite to a queue and follows FILO (First in Last Out). This means the first element inserted into the stack will be the last to come out. You can think of this structure similar to a stack of plates.
Playlist: • Queue Data Structure T...
◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python
tech-with-tim.....
📸 Instagram: / tech_with_tim
🌎 Website techwithtim.net
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-rusci. .
📂 GitHub: github.com/tec...
🔊 Podcast: anchor.fm/tech...
💵 One-Time Donations: www.paypal.com....
💰 Patreon: / techwithtim
◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
Tags:
Tech With Tim
Stacks
Stacks Data Structure
Stacks Tutorial Computer Science
Data Structure Stacks
#stacks #DataStructure
Hi. This is actually my first time of hearing about FILO. Usually this concept is represented by LIFO, but as they say, every day learn something new. Again, some python example would be nice here. Thanks for the tutorial.
Best educational content on the platform for me
:)
these are fantastic explanations & are very easy to understand- thanks a lot for taking the time to upload these tutorials!
its horse shit...doesnt even show how its done syntactically
Thank you Tim!
Nice videos. Make some on inplementation of these concepts. Thank you Tim :D
You are the best❤
This is great.
What’s the purpose of using 2 Stacks to be a Queue at all? Why not use a Queue itself?
simple and easy, couldn't ask for more !
subscribers++;
Great video. Please make theoretical video series about algorithms as well.
thanks.
Instead of using the second stack as temp, pop all the elements from stack1 and push into stack2 and pop the second stack is it right?
Only pop work with python list , how to use other methods on list or any other way
class Stack:
def __init__(self, limit):
self.stack = []
self.limit = limit
def get_length(self):
return len(self.stack)
def push(self, data):
if self.get_length() < self.limit:
self.stack.append(data)
else:
raise Exception("Stack is full")
def insert_at(self, index, data):
if 0
It is also called as *LIFO* right?
Yes same thing
@@TechWithTim cool thanks for the clarification
@@TechWithTim Def not the same thing. A Stack is labeled LIFO. The Last Item inserted is the First Out. You said it correctly at 18 seconds.
But why would you use 2 stacks to simulate a queue when you could just use a queue? Didn't really get that?
Next, how to reverse a linked list.
😁
Next linked list
It’s coming soon dw ;)
First out last in???
LIFO